1、在<template>部分中在<el-table>添加:row-key="getRowKey"
<el-table
v-loading="listLoading"
:data="list"
stripe
border
fit
style="width: 100%"
:row-key="getRowKey"
@selection-change="selectionChange"
>
2、在<template>部分中在<el-table-column>有属性type="selection"列添加:reserve-selection="true"
<el-table-column
type="selection"
:reserve-selection="true"
width="40"
/>
3、在methods里面添加方法
getRowKey(row) {
return row.id
},
完成!!!!!