mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-05-01 14:49:00 +08:00
Compare commits
2 Commits
864b537164
...
0a93419eb5
Author | SHA1 | Date | |
---|---|---|---|
|
0a93419eb5 | ||
|
334310d3b7 |
@ -13,7 +13,15 @@ const permission = {
|
|||||||
mounted(el, binding) {
|
mounted(el, binding) {
|
||||||
const currentRoute = unref(router.currentRoute)
|
const currentRoute = unref(router.currentRoute)
|
||||||
const btns = currentRoute.meta?.btns?.map(item => item.code) || []
|
const btns = currentRoute.meta?.btns?.map(item => item.code) || []
|
||||||
if (!btns.includes(binding.value)) {
|
let permissionBtns = []
|
||||||
|
|
||||||
|
if (Array.isArray(permissionBtns)) {
|
||||||
|
permissionBtns = binding.value
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
permissionBtns = binding.value?.split(',')
|
||||||
|
}
|
||||||
|
if (!btns.filter(item => permissionBtns.includes(item)).length) {
|
||||||
el.remove()
|
el.remove()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user