签入版本
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s

This commit is contained in:
2026-09-16 10:08:07 +08:00
commit fda0fe1a53
820 changed files with 97186 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { ObjectDirective } from 'vue';
import { usePermission } from '@/hooks/web/usePermission';
export const perm: ObjectDirective = {
mounted(el: HTMLButtonElement, binding) {
if (binding.value == undefined) return;
const { action, effect } = binding.value;
const { hasSomePermission } = usePermission();
if (!hasSomePermission(binding.value)) {
el.parentNode.removeChild(el)
}
},
};
export const perms: ObjectDirective = {
mounted(el: HTMLButtonElement, binding) {
if (binding.value == undefined) return;
const { action, effect } = binding.value;
const { hasEveryPermission } = usePermission();
if (!hasEveryPermission(binding.value)) {
el.parentNode.removeChild(el)
}
},
};