el中selection分页时继续保持上一页选中的状态 并取消选中状态
el中selection分页时继续保持上一页选中的状态 并取消选中状态
table中写上row-key
type = 'selection' 中写上 :reserve-selection="true"
<el-table :data="tableData" style="width: 100%; color: #333" :header-cell-style="{ color: '#4E89FF' }"
v-loading="loading" ref="recordTable" @selection-change="handleSelectionChange" row-key="orderId">
<el-table-column type="selection" width="55" :reserve-selection="true">
</el-table-column>
</el-table>
但是查询的时候不想保持状态,起初的思路是将 reserve-selection="false" 但是失败了,
成功用法用 this.$refs.recordTable.clearSelection();