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
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM