We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51f51a8 commit 7c4befbCopy full SHA for 7c4befb
src/permission.js
@@ -87,12 +87,19 @@ const action = Vue.directive('action', {
87
const permissionId = vnode.context.$route.meta.permission
88
let actions = []
89
roles.permissions.forEach(p => {
90
- if (p.permissionId !== permissionId) {
91
- return
+ //$route.meta.permission 是否配置Array类型
+ if (Array.isArray(permissionId)) {
92
+ if (!permissionId.includes(p.permissionId)) {
93
+ return
94
+ }
95
+ } else {
96
+ if (p.permissionId !== permissionId) {
97
98
99
}
100
actions = p.actionList
101
})
- if (actions.indexOf(actionName) < 0) {
102
+ if (!actions.includes(actionName)) {
103
el.parentNode && el.parentNode.removeChild(el) || (el.style.display = 'none')
104
105
0 commit comments