1.需求描述

根据权限控制某列中显示与隐藏


2.使用场景

根据不同用户(普通用户,vip用户),展示对应的列


3.解决思路

将原来的columns copy一份,然后根据权限去让它过滤对应的列,就能返回最新的columns了

举个例子,代码如下

created() {
    userType(type) {
      // type: 1 普通用户   2 vip用户  如果是普通用户则不能看到 couponAbleNum 这一列。
      if (type == '1') { //此处判断不用用户类型是否有有对应的列权限
        this.columns = this.columns.filter(col => col.type !== 'couponAbleNum' )
      } else {
        this.columns = this.columnsCopy
      }
    }
  }

 



相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2021-11-20
  • 2022-01-28
  • 2022-12-23
  • 2021-12-18
  • 2021-12-18
猜你喜欢
  • 2021-12-11
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
相关资源
相似解决方案