mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-07-28 00:00:12 +08:00
commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
|
||||
const hasPermission = {
|
||||
install(Vue, options) {
|
||||
Vue.directive('permission', {
|
||||
bind(el, binding, vnode) {
|
||||
if (binding.value) {
|
||||
const permissionList = Vue.prototype.$authorities
|
||||
if (permissionList && permissionList.length && !permissionList.includes(binding.value)) {
|
||||
el.style.display = 'none'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default hasPermission
|
||||
Reference in New Issue
Block a user