提供一個方法, 通過添加相應類來控制樣式,設置 display: none ,達到隱藏 checkbox 的目的。 利用Table Attributes 屬性里面的 cell-class-name 屬性,添加單元格的class <template>
<el-table :cell-class-name="cellcb" ... >
</el-table>
</template>
<script> methods: { cellcb(row){ if(row.row.checkStatus === 1&&row.columnIndex === 0){ return "myCell" } } </script>
<style> .myCell .el-checkbox__input { display: none } </style>
記錄下,轉自:https://www.imooc.com/wenda/detail/513985
隱藏表頭中的全選框
::v-deep .el-table__header-wrapper .el-checkbox{
display:none
}