用table事件
@selection-change="handleSelectionChange"
handleSelectionChange(val) {
//为了过滤翻页的时候不把重复的加进去
val = val.filter(item => !this.echoList.some(e => e.id === item.id));
this.echoList = [...this.echoList, ...val] //在data定义一个数组echoList
},
勾选回显的方法
echo(questions) {
if (questions) {
for (let index = 0; index < questions.length; index++) {
const question = questions[index];
if (this.echoList.findIndex(e => e.id === question.id) > -1) {
this.$nextTick(() => {
this.$refs.clientTable.toggleRowSelection(question, true);
})
}
}
}
},