el-table多选分页时,记住其他页的选中状态

2022-07-15 14:08:52

效果图:

在这里插入图片描述

实现方法:

核心是el-table-columnreserve-selection属性
在这里插入图片描述

<el-table:data="tableData":row-key="getRowKey"@selection-change="handleSelectionChange"@row-click="rowClick"><el-table-columntype="selection"width="55":reserve-selection="true"/>
        ...</el-table>
getRowKey(row){return row.id},handleSelectionChange(selected){
      console.log('选中的数据list---', selected)},rowClick(row){this.$refs.tableData.toggleRowSelection(row)}
  • 作者:String佳佳
  • 原文链接:https://blog.csdn.net/weixin_44171757/article/details/124491606
    更新时间:2022-07-15 14:08:52