- 在el-table中添加
:row-key="RowKey"
-
<el-table ref="table" :data="data.tableData" style="width: 100%; margin-top: 10px" v-loading="data.loading" height="400px" @selection-change="handleSelectionChange" :row-key="RowKey" >
多选框的一列,添加
:reserve-selection="true"
-
<el-table-column type="selection" width="55" :reserve-selection="true"> </el-table-column>
添加函数
-
function RowKey(row) { return row.id; }
提交完数据记得清除数据
-
const table = ref(null); table.value.clearSelection();
element-ui中的表格分页勾选,记住上一页的勾选状态
最新推荐文章于 2025-06-11 10:29:01 发布