問題1. 在表格中使用type='selection'實現多選,但表頭中用label無法添加全選字樣
解決方法:使用css僞類元素添加
.el-table__header .has-gutter tr .el-table-column--selection .cell .el-checkbox:before(或after) {
content: "全選 ";
}
問題2: 在表格中使用type='selection'實現多選,需要禁用某一行
解決方法:<el-table-column type="selection" :selectable='checkboxSelect' width="120"></el-table-column>
checkboxSelect (row, rowIndex) {
if (rowIndex == 0) {
return false // 禁用
}else{
return true // 不禁用
}
}