(vue)iView隐藏表格列

  • Post author:
  • Post category:vue




(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



版权声明:本文为qq_44754635原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。