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
提交
取消
