版本
vue版本:3.0.7
element-plus:1.0.2
问题概述
element-plus框架的el-table组件toggleRowSelection函数设置选中值无效;
//设置无效
this.$refs.multipleTable.toggleRowSelection(this.popup_config.table.list[b],true);
解决思路
初次用setTimeout测试2000毫秒延迟生效了,断定是el-table未渲染完成导致;
故:加上$nextTick方法,dom更新完成后会进入回调;
//dom更新完才执行nextTick回调
this.$nextTick(()=>{
this.$refs.multipleTable.toggleRowSelection(this.popup_config.table.list[b],true);
})