// 权限指令实现
import { Directive } from "vue";
import { useAuthStore } from "@/stores/modules/auth";
const permissionDirective: Directive = {
    mounted(el, binding) {
        const authStore = useAuthStore();

        const hasPerm = authStore.hasPermission(binding.value);

        if (!hasPerm) {
            el.parentNode?.removeChild(el);
        }
    }
};
export default permissionDirective;
