(vue)iView隐藏表格列
<Table ref="selection" :columns="colHidden" :data="tableData"> </Table>
data(){
return {
columns:{
{
type: "selection",
width: 60,
align: "center",
},
...
{
type: "描述",
key: "desc",
align: "center",
},
{
type: "隐藏",
key: "label",
align: "center",
hidden: true, //重点
},
{
title: "操作",
slot: "operation",
align: "center",
}
}
}
}
computed: {
colHidden: function () { //重点
return this.columns.filter(function (e) {
return !e.hidden;
});
},
},
效果:
解决参考:https://blog.csdn.net/ding43930053/article/details/125714870