mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-05-01 14:49:00 +08:00
Compare commits
No commits in common. "0a93419eb5b9ecd52e1bfbf1f99cc2b21170a49b" and "864b537164ae6c0c929a0708fc62ebd5ba75876b" have entirely different histories.
0a93419eb5
...
864b537164
@ -13,15 +13,7 @@ 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) || []
|
||||||
let permissionBtns = []
|
if (!btns.includes(binding.value)) {
|
||||||
|
|
||||||
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