选中分页中不同的行

html中

1.     :row-key="getRowKeys"

2.    :reserve-selection="true"

<el-table :data="tableData" border stripe v-loading="loading" :row-key="getRowKeys" @selection-change="handleSelectionChangeUser" class="first-tab mt-10">
<el-table-column type="selection" :reserve-selection="true" width="55" align="center"></el-table-column>
3.data中
data() {
return {
getRowKeys(row) {
return row.id
},
}
}
4. methods中
handleSelectionChangeUser(val) {
this.traineeData = val
}
posted @ 2020-05-06 15:17  笨笨白  阅读(149)  评论(0编辑  收藏  举报