<el-table
ref="orderTable"
:data="list"
style="width: 100%;"
@selection-change="handleSelectionChange"
v-loading="listLoading"
border
default-expand-all
:cell-class-name="cell => cell.column.type === 'expand' && cell.row.status !== 2 ? 'noExpandColumn' : ''"
:row-class-name="row => row.row.status !== 2 ? 'noExpandRow' : ''"
>
...省略部分代码
</el-table>
css如下 可以根据业务自行调整
由于column-item中获取不到row和column 所以只能在table中 将需要过滤的列 或行 添加一个class
然后用css方式隐藏
<style lang="scss">
.noExpandColumn .cell{
visibility: hidden;
}
.noExpandRow+tr{
display: none;
}
</style>