xiaoxian521 3 лет назад
Родитель
Сommit
653bafaa2b
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/directives/permission/index.ts

+ 1 - 1
src/directives/permission/index.ts

@@ -9,7 +9,7 @@ export const auth: Directive = {
       const authRoles = value;
       const hasAuth = usePermissionStoreHook().buttonAuth.includes(authRoles);
       if (!hasAuth) {
-        el.style.display = "none";
+        el.parentNode.removeChild(el);
       }
     } else {
       throw new Error("need roles! Like v-auth=\"['admin','test']\"");