toggle() {
this.$nextTick(function() {
this.dialogTableData.map(item => {
var a = this.tableData.findIndex(v => v.companyId == item.id)
if(a !== -1) {
this.$refs.multipleTable.toggleRowSelection(item, true)
} else {
this.$refs.multipleTable.toggleRowSelection(item, false)
}
})
})
},
<el-table
border
height="40vh"
:data="dialogTableData"
style="width: 100%"
:header-cell-style="{ background: '#eef1f6', color: '#333333' }"
:row-style="rowClass"
:row-key="row => { return row.id }"
ref="multipleTable"
@select="selectionChangeHandler"
/>
然后调用方法进行回显