import { useAuthStore } from "@/store";
export default {
  mounted(el, binding) {
    if (!binding.value) {
      throw new Error("指令v-roles未配置要检查的角色");
    }
    if (binding.value instanceof Array) {
      if (!binding.value.includes(useAuthStore().user.roleId)) {
        el.parentNode.removeChild(el);
      }
    } else {
      if (binding.value != useAuthStore().user.roleId) {
        el.parentNode.removeChild(el);
      }
    }

  }
}