Browse Source

feat(nav): add Discover link for logged-in users

Made-with: Cursor
main
npmrun 11 hours ago
parent
commit
fbc865c558
  1. 20
      app/components/AppShell.vue

20
app/components/AppShell.vue

@ -30,6 +30,7 @@ const displayName = computed(() => {
})
const homeNav = { label: '首页', to: '/', icon: 'i-lucide-house' } as const
const discoverNav = { label: '发现', to: '/discover', icon: 'i-lucide-compass' } as const
const consoleSubNav = [
{ label: '资料', to: '/me/profile', icon: 'i-lucide-user-round' },
@ -43,9 +44,12 @@ const consoleDropdownItems = computed(() => [
consoleSubNav.map((i) => ({ label: i.label, icon: i.icon, to: i.to })),
])
/** 移动端汉堡菜单:首页 + 「控制台」分组下四个子项 */
/** 移动端汉堡菜单:首页、发现 + 「控制台」分组下四个子项 */
const mobileMenuItems = computed(() => [
[{ label: homeNav.label, icon: homeNav.icon, to: homeNav.to }],
[
{ label: homeNav.label, icon: homeNav.icon, to: homeNav.to },
{ label: discoverNav.label, icon: discoverNav.icon, to: discoverNav.to },
],
[{ type: 'label' as const, label: '控制台' }, ...consoleSubNav.map((i) => ({ label: i.label, icon: i.icon, to: i.to }))],
])
@ -133,6 +137,18 @@ async function logout() {
navActive(homeNav.to) ? 'bg-elevated text-highlighted' : 'text-muted',
]"
/>
<UButton
:to="discoverNav.to"
:icon="discoverNav.icon"
:label="discoverNav.label"
color="neutral"
variant="ghost"
size="sm"
:class="[
'shrink-0 rounded-md',
navActive(discoverNav.to) ? 'bg-elevated text-highlighted' : 'text-muted',
]"
/>
<UDropdownMenu :items="consoleDropdownItems" :content="{ align: 'start' }">
<UButton
color="neutral"

Loading…
Cancel
Save