1404/11/04- first
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user