<el-table
ref="tableRef"
:data="tableData"
@selection-change="handleSelectionChange"
:row-key="getRowKeys">
<el-table-column type="selection" :reserve-selection="true">
handleSelectionChange(val) {
this.multipleSelection = val
},
getRowKeys(row) {
return row.id
},
openDialog(){ //新开窗口需要清空之前选择
if(this.$refs.tableRef){
this.$refs.tableRef.clearSelection()
}
}
参考:
https://element.eleme.cn/#/zh-CN/component/table
https://blog.csdn.net/mm0715/article/details/107185886/
https://blog.csdn.net/weixin_43828444/article/details/98873426