mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2025-02-22 02:32:49 +08:00
优化按钮权限控制
This commit is contained in:
parent
2f83751e3a
commit
de3fab92f8
@ -2,11 +2,11 @@
|
||||
const hasPermission = {
|
||||
install(app) {
|
||||
app.directive('permission', {
|
||||
beforeMount(el, binding) {
|
||||
mounted(el, binding) {
|
||||
if (binding.value) {
|
||||
const permissionList = app.config.globalProperties.$global.user.authorities
|
||||
if (permissionList && permissionList.length && !permissionList.includes(binding.value) && import.meta.env.MODE != 'demo') {
|
||||
el.style.display = 'none'
|
||||
el.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user