el-table 翻页多选、选择框禁选
1、翻页多选
实现::row-key="getRowKeys" 配合:reserve-selection="true"
bash
<el-table
:data="list"
:row-key="getRowKeys"
ref="multipleTable"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="35" :reserve-selection="true"> </el-table-column>
</el-table>
methods: {
getRowKeys(row){
return row.id
}
}
2、选择框禁选
实现:type="selection"的列绑定selectable方法。
bash
<el-table-column
type="selection"
width="50"
:selectable="selectEnable">
</el-table-column>
methods: {
selectEnable(row, rowindex) {
// 这里可以根据数据某个特性控制是否禁止选择
return true;
},
}