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>
相关推荐
天高任鸟飞dyz13 小时前
tabs切换#
javascript·vue.js·elementui
菜鸟una13 小时前
【layout组件 与 路由镶嵌】vue3 后台管理系统
前端·vue.js·elementui·typescript
m0_627827521 天前
vue3中 input 中放大镜在后面
javascript·vue.js·elementui
滿3 天前
Vue3 + Element Plus 动态表单实现
javascript·vue.js·elementui
ドロロ8063 天前
element-plus点击重置表单,却没有进行重置操作
javascript·vue.js·elementui
緑水長流*z4 天前
(14)Element Plus项目综合案例
vue.js·elementui·vue3·element plus·elementplus项目·完整项目案例·项目学习笔记
牧杉-惊蛰5 天前
VUE+ElementUI 使用el-input类型type=“number” 时,取消右边的上下箭头
前端·vue.js·elementui
小小弯_Shelby6 天前
ElementUI 表格el-table自适应高度设置
前端·elementui
愛芳芳8 天前
springboot+mysql+element-plus+vue完整实现汽车租赁系统
前端·vue.js·spring boot·后端·mysql·elementui·汽车
漫无目的行走的月亮9 天前
VUE实现todolist
前端·vue.js·elementui