element-ui设置选中的table的行的多选框toggleRowSelection不起作用

1.最外面添加this.$nextTick(()=>{})

2.toggleRowSelection里面要循环选中的那个数组。

this.$nextTick(()=>{
    this.multipleSelection.forEach(row => {  //tableData所有表格的内容数组。multipleSelection要选中的内容数组
        this.$refs.multipleTable.toggleRowSelection(this.tableData.find(item=>{
              return row.name == item.name;
  // 注意这里寻找的字段要唯一,示例仅参考
           }),true);
    });
})

Guess you like

Origin blog.csdn.net/qq_33769914/article/details/120892088