Files
boursecu_admin/src/core/layouts/composnts/BaseMenuItem.vue
T

33 lines
859 B
Vue
Raw Normal View History

2026-01-24 17:45:54 +03:30
<template>
<AMenuItem
:disabled="props.item.meta?.disabled ?? false"
:key="props.item.name"
@click="handleClickMenuItem(item)"
>
<template #icon>
<BaseIcon :size="menuIconSize" v-if="props.item.meta?.icon" :icon="props.item.meta?.icon" />
</template>
<span>{{ props.item.meta.title ?? props.item.name }}</span>
<!-- <template #title>1111</template>-->
<!-- <div class="flex"></div>-->
</AMenuItem>
</template>
<script setup lang="ts">
import { menuIconSize } from '@root/config'
import type { RouteRecordRaw } from 'vue-router'
const router = useRouter()
interface Props {
item: RouteRecordRaw
}
const props = withDefaults(defineProps<Props>(), {})
async function handleClickMenuItem(item: RouteRecordRaw) {
router.push({ name: item.name })
}
</script>
<style scoped lang="less"></style>