2 回答

嗶嗶one
TA貢獻1854條經驗 獲得超8個贊
提供一個方法,
通過添加相應類來控制樣式,設置 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>

紅顏莎娜
TA貢獻1842條經驗 獲得超13個贊
//狀態為1時不顯示復選框 試試這樣
<el-table-column type="selection" width="45" v-if="checkStatus != 1"></el-table-column>
添加回答
舉報
0/150
提交
取消