el-table多选框根据条件隐藏显示
2024-09-08 19:31:53
提供一个方法,
通过添加相应类来控制样式,设置 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
}
最新文章
- AlloyRenderingEngine燃烧的进度条
- MSSQL Server数据库的四种连接方法和sql连接字符串
- 去掉开始菜单中新装程序的红色标记【Windows】
- Stereo Matching 立体匹配学习资料
- HDU 1506 Largest Rectangle in a Histogram (dp左右处理边界的矩形问题)
- 十一、Swing
- 查找指定目录下的文件 .xml
- Linux下的Crontab应用
- asp.net 下OnClientClick的妙用
- Winform动态加载TabControl用法
- PHP __autoload函数知识点
- php正则表达式的基本语法
- [刷题]Google Code Jam 2017 - Round1 C Problem A. Ample Syrup
- SpringCloud学习之SpringCloudStream&;集成kafka
- chrome添加离线插件
- MySQL事务锁问题-Lock wait timeout exceeded
- c++入门之关于cin,cout以及数据流的认识
- bzoj千题计划301:bzoj4259: 残缺的字符串
- 测试mktime和localtime_r性能及优化方法
- 【Express系列】第2篇——主程序的改造