xiaoxian521 пре 3 година
родитељ
комит
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']\"");