为了满足特殊需求,需要去掉头部chexkbox的时候,官方的组件并不满足,那么就需要自己自定义去掉头部的checkbox,上代码:
el-table头部添加
:header-cell-class-name="hideHeaderCheckBox"
方法
methods: {
hideHeaderCheckBox(row) {
if (row.columnIndex === 0 && row.rowIndex === 0) {
return 'hideHeaderCheckBox'
}
}
}
添加css样式
::v-deep{
.hideHeaderCheckBox{
.el-checkbox{
display: none;
}
.cell:before{
content: '定义';
}
}
}



1004

被折叠的 条评论
为什么被折叠?



