element-plus 根据条件显示多选框

代码如下:

html 复制代码
<el-table :data="pager.lists" @selection-change="handleSelectionChange" row-key="id" :tree-props="{ checkStrictly: true }" :cell-class-name="cellClass">
<el-table-column type="selection" width="55" :selectable="selectable" />
</el-table>

<script lang="ts" setup name="examLists">
const selectable = (row: any) => row.pid === 0
const cellClass = (row: any) => {
    return row.row.pid === 0 ? '' : 'myCell'
}
</script>

<style>
.myCell .el-checkbox__input {
    display: none !important;
}
</style>
相关推荐
拼图20911 小时前
element-plus——图标推荐
javascript·vue.js·elementui
军军君013 天前
基于Springboot+UniApp+Ai实现模拟面试小工具三:后端项目基础框架搭建上
前端·vue.js·spring boot·面试·elementui·微信小程序·uni-app
你这-坏孩子3 天前
更改elementui 图标 css content
前端·css·elementui
梁辰兴4 天前
企业培训笔记:宠物信息管理--实现宠物信息分页查询
笔记·elementui·mybatis·vue3·springboot·宠物
军军君015 天前
基于Springboot+UniApp+Ai实现模拟面试小工具四:后端项目基础框架搭建下
spring boot·spring·面试·elementui·typescript·uni-app·mybatis
海天胜景5 天前
vue3 el-table动态表头
javascript·vue.js·elementui
我在北京coding6 天前
el-tree 懒加载 loadNode
前端·vue.js·elementui
布兰妮甜7 天前
Vue+ElementUI聊天室开发指南
前端·javascript·vue.js·elementui
鱼 空7 天前
解决el-table右下角被挡住部分
javascript·vue.js·elementui
ruanhongbiao8 天前
饿了么el-upload上传组件报错:TypeError: ***.upload.addEventListener is not a function
javascript·elementui