首页 > 其他分享 >按钮权限

按钮权限

时间:2022-11-12 10:25:58浏览次数:33  
标签:style obj dom state 按钮 权限

directives/index.js
自定义指令:
  // 按钮权限控制
  showButton: {
    inserted(dom, obj) {
      if (!store.state.user.userInfo.roles.points.includes(obj.value)) {
        dom.style.display = 'none'
      }
    },
    componentUpdated(dom, obj) {
      if (!store.state.user.userInfo.roles.points.includes(obj.value)) {
        dom.style.display = 'none'
      }
    }
  }

xxx.vue
//按钮
v-showButton="employees_del_button"

标签:style,obj,dom,state,按钮,权限
From: https://www.cnblogs.com/strundent/p/16882788.html

相关文章