<el-table
:data="tableData"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
fixed>
</el-table-column>
</el-table>
methods: {
handleSelectionChange(selection) {
if (selection.length > 1) {
this.$refs.elTable.clearSelection(); // 清空所有选择
this.$refs.elTable.toggleRowSelection(selection.pop()); // 设置选择项
}
},
}