elementui分页记录,reserve-selection

第一步:
标签中加上 :row-key="getRowKeys"

第二步:
此行加上:reserve-selection="true"

第三步:
在 data() {
return {
multipleSelection:[],//复选框
getRowKeys(row) {//记录每行的key值
return row.id;
},
select_order_number:'',//表格select选中的条数
select_orderId:[],//表格select复选框选中的id

}
}

第四步:
handleSelectionChange(rows) {//复选框
this.multipleSelection = rows;
this.select_order_number = this.multipleSelection.length;

this.select_orderId = [];
if (rows) {
rows.forEach(row => {
if (row) {
this.select_orderId.push(row.id);
}
});
}
}

第五步:
标签中加上 @selection-change="handleSelectionChange" 事件

 

转载于:https://www.cnblogs.com/xiaofenghuang/p/10297034.html

你可能感兴趣的:(elementui分页记录,reserve-selection)