Skip to content

Commit 72b2274

Browse files
authored
Merge pull request #132 from j-joker/master
Fix(directive):remove the dom operation in v-permission which will ca…
2 parents 9b41232 + 1001639 commit 72b2274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/directives/permission/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const permission: DirectiveOptions = {
1111
return permissionRoles.includes(role)
1212
})
1313
if (!hasPermission) {
14-
el.parentNode && el.parentNode.removeChild(el)
14+
el.style.display = 'none'
1515
}
1616
} else {
1717
throw new Error('need roles! Like v-permission="[\'admin\',\'editor\']"')

0 commit comments

Comments
 (0)