element-ui table行和多选框的联动选择
作者:互联网
// 高亮显示选择行
highlight-current-row
// table 事件绑定
@row-click="rowFinanceChecked" @select-all="(selection)=>payEntry.checks = selection.map((m) => m.id)" @select="(selection)=>payEntry.checks = selection.map((m) => m.id)
// 选中行事件
rowFinanceChecked(row, column, event) {
const index = this.payEntry.checks.indexOf(row.id)
if (index >= 0) {
this.$refs.needPayBill.toggleRowSelection(row, false)
this.payEntry.checks.splice(index, 1)
} else {
this.$refs.needPayBill.toggleRowSelection(row, true)
this.payEntry.checks.push(row.id)
}
},
标签:行和多,selection,index,payEntry,element,ui,id,checks,row 来源: https://blog.csdn.net/weixin_43340087/article/details/121393167