Skip to content

Commit

Permalink
Merge pull request #132 from j-joker/master
Browse files Browse the repository at this point in the history
Fix(directive):remove the dom operation in v-permission which will ca…
  • Loading branch information
Armour authored May 7, 2020
2 parents 9b41232 + 1001639 commit 72b2274
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/directives/permission/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const permission: DirectiveOptions = {
return permissionRoles.includes(role)
})
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
el.style.display = 'none'
}
} else {
throw new Error('need roles! Like v-permission="[\'admin\',\'editor\']"')
Expand Down

0 comments on commit 72b2274

Please sign in to comment.