From 653bafaa2bd4182b83529c285b97d1b9efa894cf Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 13 Dec 2021 13:54:28 +0800 Subject: [PATCH] fix: permission directive --- src/directives/permission/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directives/permission/index.ts b/src/directives/permission/index.ts index 649e8d098..c31150887 100644 --- a/src/directives/permission/index.ts +++ b/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']\"");