<template>
<el-table
ref="multipleTable"
:data="tableData"
@selection-change="handleSelectionChange"
:row-key="getRowKeys"
>
<el-table-column
type="selection"
width="55"
:reserve-selection="true"
/>
<!-- 其他列的定义 -->
</el-table>
</template>
<script>
export default {
data() {
return {
tableData: [], // 表格数据
multipleSelection: [], // 选中的数据
};
},
methods: {
// 获取行的唯一标识
getRowKeys(row) {
return row.id; // 假设每行数据都有一个唯一的 id 属性
},
// 选中状态改变时的回调
handleSelectionChange(val) {
this.multipleSelection = val;
},
},
};
</script>
09-22
464

12-23
7970
