1.在selection行加设置属性reserve-selection为true
2.在el-table 设置row-key
<el-table :data="list" @selection-change="handleSelectionChange"
class="mt-16 factory-table normal-size" v-loading="loading" :row-key="getRowKey">
<template #empty>
<empty-box class="mt-44" />
</template>
<el-table-column type="selection" width="70" :reserve-selection="true"/>
<el-table-column prop="avatar" label="头像" />
</el-table>
ts 设置row-key 的值
const handleSelectionChange = (val: any) => {
multipleSelection.value = val
}
const getRowKey = (row: any) => {
return row.user_id
}