美文网首页
element UI table筛选重置勾上默认项

element UI table筛选重置勾上默认项

作者: 地主家也没余粮叻 | 来源:发表于2018-07-17 01:34 被阅读0次

<el-table refs="tableLsit" @filter-change="filterTagTable">

<el-table-column label='xx'  type="xx" :filters="quesType"

:filtered-value="quesCheckList" :coluumn-key="'aType'" filter-multiple>

<template slot-scope="scope">

{{scope.row.type}}

</template>

</el-table>

<script>

const getQuesCheckList = _ =>{

return [0,2,3]

}

export default{

data(){
    return{

        quesCheckList:getQuesCheckList ()

    }

},

methods:{

filterTagTable(filters){

let atype = filters.aType

if(atype ===0){

    const arr = getQuesCheckList ()

    this.$refs.tableLsit.columns[2].filteredValue=arr
        this.getAll(arr )

       return

        }

    if(atype) this.getAll(atype)

}

}

}

</script>

注:因为重置事件没有点击事件,是封装好的,所以需要这么操作

相关文章

网友评论

      本文标题:element UI table筛选重置勾上默认项

      本文链接:https://www.haomeiwen.com/subject/vjgipftx.html