el-table 换页保持选中
<el-table
:row-key="(row) => row.accountId"
ref="multipleTable"
:data="tableData"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" :reserve-selection="true" width="55">
</el-table-column>
...........
</el-table>
- 首先在el-table加上行唯一id :row-key="(row) => row.accountId" 注:accountId不是指定,是根据该行唯一值
- 在选项列中加上 :reserve-selection=“true”
3.清楚已保存的默认选中状态
this.$refs.multipleTable.clearSelection();