fix: 修复动态路由 rank 问题

This commit is contained in:
xiaoxian521
2022-12-07 17:22:07 +08:00
parent 4ccf200059
commit 0b1bd19179
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']\"");
}