效果:
- option里 设置selection为true
- 勾选的同时会回调selectionChange方法返回当前选中的数据,toggleRowSelection方法设置行勾选
handleSelectionChange(list) { if (list.length > 1) { const newVal = list.shift() this.$refs.crud.toggleRowSelection(newVal, false) } this.selectionList = list },
3. 样式穿透隐藏全选复选框
/* 隐藏表格左上角复选框 */
.page ::v-deep .el-table__fixed-header-wrapper .el-checkbox__inner {
display: none !important;
}