问题:勾选的数据分页再回来回消失
1.在el-table中加 :row-key="getRowKey"
const getRowKey = (row) => {
return row.id; // id必须是唯一的
};
2.给type为selection的el-table-column添加上reserve-selection属性
<el-tableref="multipleTableRef"border:data="data.rows"@selection-change="handleSelectionChange"v-loading="data.dataListLoading"element-loading-text="数据加载中...":row-key="getRowKey"><el-table-column type="selection" reserve-selection width="55" /></el-table>const getRowKey = (row) => {return row.id;};