
<!--权限组件-->

<script setup lang="ts">
import {menuStore} from "@/stores/menu.ts";
import {computed} from "vue";

const props = defineProps<{
    permission: string;
}>();
const menuStoreInstance = menuStore(); // 菜单持久化

// 指示当前用户是否拥有该权限
const isHavePermission = computed(() => {
    return menuStoreInstance.checkOperationPermission(props.permission);
});


</script>

<template>
 <slot v-if="isHavePermission"> </slot>
</template>

<style scoped>

</style>