<el-table
ref="singleTable"
:data="allShopData"
:header-cell-class-name="headerCellStyle"
tooltip-effect="dark"
style="width: 100%"
@select="selectChange"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"> </el-table-column>
// 多选框选中数据
handleSelectionChange(selection) {
this.selectionRows = selection;
this.ids = selection.map((item) => item.customerId);
this.multiple = !selection.length;
},
// 单选框选中的数据
selectChange(selection) {
if (selection.length > 1) {
const del_row = selection.shift();
this.$refs.singleTable.toggleRowSelection(del_row, false);
}
console.log(selection);
this.selectArr = selection;
},
select | 当用户手动勾选数据行的 Checkbox 时触发的事件 | selection, row |