File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -84,17 +84,16 @@ const action = Vue.directive('action', {
84
84
bind : function ( el , binding , vnode ) {
85
85
const actionName = binding . arg
86
86
const roles = store . getters . roles
87
- const permissionId = vnode . context . $route . meta . permission
88
- let actions = [ ]
87
+ const elVal = vnode . context . $route . meta . permission
88
+ const permissionId = elVal instanceof String && [ elVal ] || elVal
89
89
roles . permissions . forEach ( p => {
90
- if ( p . permissionId !== permissionId ) {
90
+ if ( ! permissionId . includes ( p . permissionId ) ) {
91
91
return
92
92
}
93
- actions = p . actionList
93
+ if ( p . actionList && ! p . actionList . includes ( actionName ) ) {
94
+ el . parentNode && el . parentNode . removeChild ( el ) || ( el . style . display = 'none' )
95
+ }
94
96
} )
95
- if ( actions . indexOf ( actionName ) < 0 ) {
96
- el . parentNode && el . parentNode . removeChild ( el ) || ( el . style . display = 'none' )
97
- }
98
97
}
99
98
} )
100
99
You canβt perform that action at this time.
0 commit comments