element table切换分页不勾选的自带方法

table表格加row-key标识选中行唯一标识,多选框加reserve-selection设置为true

<template>
 <el-table
    v-loading="loading"
    ref="multipleTable"
    tooltip-effect="dark"
    :row-key="getRowKey">
    <el-table-column label="" type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
 </table>
</template>
<script>
  methods: {
  // 指定一个key标识这一行的数据
    getRowKey (row) {
      return row.id
    }
  }
</script>

猜你喜欢

转载自www.cnblogs.com/adbg/p/11899324.html