fix: 修复动态路由 rank 问题

This commit is contained in:
xiaoxian521
2022-12-07 17:14:29 +08:00
parent 7987a18c70
commit 1419df10d2
2 changed files with 10 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ export const auth: Directive = {
mounted(el: HTMLElement, binding: DirectiveBinding) {
const { value } = binding;
if (value) {
!hasAuth(value) && el.parentNode.removeChild(el);
!hasAuth(value) && el.parentNode?.removeChild(el);
} else {
throw new Error("need auths! Like v-auth=\"['btn.add','btn.edit']\"");
}