TOPVERSE_Official/config/use-nav.ts

73 lines
1.8 KiB
TypeScript
Raw Normal View History

2023-04-27 13:58:47 +08:00
import type { colors } from 'unocss/preset-mini'
interface NavMenu {
title: string
icon?: string
href?: string
subtitle?: string
iconColor?: keyof typeof colors
child?: NavMenu[]
}
export function useNav(): NavMenu[] {
2023-05-04 00:47:08 +08:00
const { locale } = useI18n()
const path = locale.value === 'zh' ? '/' : `/${locale.value}`
2023-04-27 13:58:47 +08:00
return [
{
title: 'nav.home',
2023-05-04 00:47:08 +08:00
href: `${path}`,
2023-04-27 13:58:47 +08:00
},
{
title: 'nav.solutions.t',
child: [
{
2023-05-06 05:39:23 +08:00
title: 'nav.solutions.child.land.service[0]',
subtitle: 'nav.solutions.child.land.description[0]',
2023-05-04 00:47:08 +08:00
href: `${path}/land`,
2023-05-06 05:39:23 +08:00
icon: 'i-solar-airbuds-left-bold-duotone',
2023-04-27 13:58:47 +08:00
iconColor: 'red',
},
{
2023-05-06 05:39:23 +08:00
title: 'nav.solutions.child.land.service[1]',
subtitle: 'nav.solutions.child.land.description[1]',
href: `${path}/land`,
icon: 'i-solar-airbuds-left-bold-duotone',
iconColor: 'amber',
},
{
title: 'nav.solutions.child.land.service[2]',
subtitle: 'nav.solutions.child.land.description[2]',
href: `${path}/land`,
icon: 'i-solar-airbuds-left-bold-duotone',
2023-04-27 13:58:47 +08:00
iconColor: 'amber',
},
],
},
{
2023-05-06 05:39:23 +08:00
title: 'nav.news',
href: `${path}/news`,
2023-04-27 13:58:47 +08:00
},
2023-05-06 01:50:40 +08:00
{
2023-05-06 05:39:23 +08:00
title: 'nav.event.t',
child: [
{
title: 'nav.event.child.act[0]',
subtitle: 'nav.event.child.description[0]',
href: `${path}/land`,
icon: 'i-solar-airbuds-left-bold-duotone',
iconColor: 'red',
},
{
title: 'nav.event.child.act[1]',
subtitle: 'nav.event.child.description[1]',
href: `${path}/land`,
icon: 'i-solar-airbuds-left-bold-duotone',
iconColor: 'red',
},
],
2023-05-06 01:50:40 +08:00
},
2023-04-27 13:58:47 +08:00
]
}