增加v-permit用来控制权限
This commit is contained in:
@@ -15,6 +15,15 @@ const map = {
|
||||
}, 800)
|
||||
})
|
||||
}
|
||||
},
|
||||
permit: {
|
||||
bind(el, binding) {
|
||||
const code = binding.value
|
||||
const permits = JSON.parse(localStorage.getItem('vuex') || null)?.user?.info?.buttons || []
|
||||
if (!permits.find(e => e.id == code || e.permission == code)) {
|
||||
el.parentNode.removeChild(el)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user