fix: permission directive

This commit is contained in:
xiaoxian521 2021-12-13 13:54:28 +08:00
parent b82a3d3a2e
commit 653bafaa2b

View File

@ -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']\"");