<el-table
ref="multipleTable"
:data="userList"
tooltip-effect="dark"
style="width: 100%"
@row-click="rowclick"
@select-all="clickAll"
@select="clickSelect"
>
clickSelect(select, row) {
if (this.currentId.indexOf(row.userId) == -1) {
this.currentId.push(row.userId);
} else {
let index = this.currentId.indexOf(row.userId);
this.currentId.splice(index, 1);
}
},
rowclick(row) {
if (this.currentId.indexOf(row.userId) == -1) {
this.currentId.push(row.userId);
} else {
let index = this.currentId.indexOf(row.userId);
this.currentId.splice(index, 1);
}
},
clickAll() {
if (this.isAll) {
this.currentId.splice(0, this.currentId.length);
this.isAll = false;
} else {
this.currentId.splice(0, this.currentId.length);
this.data.forEach(item => {
this.currentId.push(item.userId);
});
this.isAll = true;
}
},