代码如下:
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>