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: [
|
|
|
|
{
|
|
|
|
title: 'nav.solutions.child.land.t',
|
|
|
|
subtitle: 'nav.solutions.child.land.description',
|
2023-05-04 00:47:08 +08:00
|
|
|
href: `${path}/land`,
|
2023-04-27 13:58:47 +08:00
|
|
|
icon: 'i-solar-accumulator-bold-duotone',
|
|
|
|
iconColor: 'red',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'nav.solutions.child.land.t',
|
|
|
|
subtitle: 'nav.solutions.child.land.description',
|
2023-05-04 00:47:08 +08:00
|
|
|
href: `${path}/landa`,
|
|
|
|
icon: 'i-solar-airbuds-case-open-line-duotone',
|
2023-04-27 13:58:47 +08:00
|
|
|
iconColor: 'amber',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'nav.test',
|
2023-05-04 00:47:08 +08:00
|
|
|
href: `${path}/test`,
|
2023-04-27 13:58:47 +08:00
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|