feat: add vue admin transition shell
This commit is contained in:
1 parent
2cdf7f9d7a
commit
f07a61f3a8
30 files changed
+2127
-7
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import type { ObjectDirective } from "vue";
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
|
||||
export const permissionDirective: ObjectDirective<HTMLElement, string> = {
|
||||
mounted(element, binding) {
|
||||
const permission = binding.value;
|
||||
if (!permission || !useAuthStore().hasPermission(permission)) {
|
||||
element.style.display = "none";
|
||||
element.setAttribute("aria-hidden", "true");
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user