el-table多选框根据条件隐藏显示

 

 

 el-table多选框根据条件隐藏显示

提供一个方法,
通过添加相应类来控制样式,设置 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
}

 

相关文章:

  • 2021-06-04
  • 2021-12-13
  • 2021-08-15
  • 2022-01-24
  • 2021-07-02
  • 2022-02-09
  • 2021-12-04
  • 2023-01-13
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
相关资源
相似解决方案