beehive/app/components/AppHeader.vue

89 lines
1.9 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 17:43:13 +08:00
to: '/',
2025-10-22 10:57:17 +08:00
icon: 'i-lucide-book-open',
2025-10-22 17:43:13 +08:00
active: route.path.startsWith('/')
2025-10-22 10:57:17 +08:00
}, {
2025-10-22 10:57:30 +08:00
label: '产品与服务',
2025-10-22 16:32:29 +08:00
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')
2025-10-22 16:32:29 +08:00
},
{
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>
2025-10-22 17:43:13 +08:00
<!-- 标题部分 -->
2025-10-22 10:57:17 +08:00
<template #title>
2025-10-22 17:43:13 +08:00
<view class="h-6 w-auto text-primary">
2025-10-22 16:32:29 +08:00
创特蜂箱
</view>
2025-10-22 10:57:17 +08:00
</template>
2025-10-22 17:43:13 +08:00
<!-- 导航菜单 -->
<UNavigationMenu
:items="items"
highlight
highlight-color="primary"
/>
2025-10-22 10:57:17 +08:00
2025-10-22 17:43:13 +08:00
<!-- 右侧区域 -->
2025-10-22 16:32:29 +08:00
<template #right>
2025-10-22 17:43:13 +08:00
<view class="text-primary">
2025-10-22 16:32:29 +08:00
商户管理
</view>
</template>
2025-10-22 10:57:17 +08:00
2025-10-22 17:43:13 +08:00
<!-- 移动端菜单 -->
2025-10-22 10:57:17 +08:00
<template #body>
2025-10-22 17:43:13 +08:00
<UNavigationMenu
:items="items"
class="-mx-2.5 bg-teal-50/80"
orientation="vertical"
/>
2025-10-22 10:57:17 +08:00
</template>
</UHeader>
</template>
2025-10-22 17:43:13 +08:00