el-table复选框选中一行之后其他行禁用
<el-table
ref="multipleTable"
:data="mirrorTableData"
@selection-change="mirrorSelectionChange"
style="width: 100%">
<el-table-column
type="selection"
:selectable="selectable"
width="55">
</el-table-column>
<el-table-column
prop="data"
show-overflow-tooltip
label="名称">
</el-table-column>
</el-table>
//是否禁用
selectable(row){
const selectArr = this.$refs.multipleTable.selection;//获取选中行
const state = selectArr.some((item) => item.id == row.id);
return (
selectArr.length < 1 || state //1:限制选中条数
);
}
产品要求表格复选框实现单选效果