beehive/app/components/AppHeader.vue

71 lines
1.7 KiB
Vue
Raw Normal View History

2025-10-22 10:57:30 +08:00
<script lang="ts" setup>
import type {NavigationMenuItem} from '@nuxt/ui'
2025-10-22 10:57:17 +08:00
const route = useRoute()
const items = computed<NavigationMenuItem[]>(() => [{
2025-10-22 10:57:30 +08:00
label: '首页',
2025-10-22 10:57:17 +08:00
to: '/docs/getting-started',
icon: 'i-lucide-book-open',
active: route.path.startsWith('/docs/getting-started')
}, {
2025-10-22 10:57:30 +08:00
label: '产品与服务',
2025-10-22 10:57:17 +08:00
icon: 'i-lucide-box',
2025-10-22 10:57:30 +08:00
active: route.path.startsWith('/docs/components'),
children: [
{label: '智慧蜂场建设', to: '/hive'},
{label: '智能蜂箱研制', to: '/hive'},
{label: '质量安全溯源', to: '/hive'},
{label: '蜂产业大数据', to: '/sensors'},
{label: '知识服务中心', to: '/sensors'},
]
2025-10-22 10:57:17 +08:00
}, {
2025-10-22 10:57:30 +08:00
label: '应用实例',
2025-10-22 10:57:17 +08:00
icon: 'i-simple-icons-figma',
to: 'https://go.nuxt.com/figma-ui',
target: '_blank'
}, {
2025-10-22 10:57:30 +08:00
label: '典型案例',
2025-10-22 10:57:17 +08:00
icon: 'i-lucide-rocket',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
2025-10-22 10:57:30 +08:00
}, {
label: '新闻资讯',
to: '/docs/components',
icon: 'i-lucide-box',
active: route.path.startsWith('/docs/components')
}, {
label: '关于我们',
to: '/docs/components',
icon: 'i-lucide-box',
active: route.path.startsWith('/docs/components')
}, {
label: '联系我们',
to: '/docs/components',
icon: 'i-lucide-box',
active: route.path.startsWith('/docs/components')
},])
2025-10-22 10:57:17 +08:00
</script>
<template>
<UHeader>
<template #title>
2025-10-22 10:57:30 +08:00
<Logo class="h-6 w-auto"/>
2025-10-22 10:57:17 +08:00
</template>
2025-10-22 10:57:30 +08:00
<UNavigationMenu :items="items"/>
2025-10-22 10:57:17 +08:00
2025-10-22 10:57:30 +08:00
<!-- <template #right>-->
<!-- <view>-->
<!-- -->
<!-- </view>-->
<!-- </template>-->
2025-10-22 10:57:17 +08:00
<template #body>
2025-10-22 10:57:30 +08:00
<UNavigationMenu :items="items" class="-mx-2.5" orientation="vertical"/>
2025-10-22 10:57:17 +08:00
</template>
</UHeader>
</template>