- 使用vuex存当前row,getters取row
- 去其它组件回来时toggleRowSelection(row, true)不生效
- 应该是函数return 取值形成了闭包,在操作页面遍历找到对应row,重新调用即可!
主要代码
computed: {
getHomePageRow () {
return this.$store.getters.getHomePageRow
}
},
watch:{
list(){
if(this.getHomePageRow.length){
// 避免有分页时无效果
this.$nextTick(()=>{
const row = this.list.find((item)=>item.id === this.getHomePageRow[0].id)
this.$refs.multipleTable.toggleRowSelection(row,true);
})
}
}
},