<script setup lang="ts">
import { useAuthStore } from '~/stores/login';
import { some } from 'lodash-es';

const props = defineProps({
  api: {
    type: String,
    required: true
  }
});

const authStore = useAuthStore();
const { permitApiList } = storeToRefs(authStore);

const permit = computed(() => {
  return some(permitApiList.value, (value) => {
    return props.api === value.menuUrl;
  });
});
</script>

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

<style scoped></style>
