mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
060ab9af91
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
24 lines
731 B
Vue
24 lines
731 B
Vue
<script setup lang="ts">
|
|
import type { ContentNavigationItem } from '@nuxt/content'
|
|
import { mapContentNavigation } from '@nuxt/ui/utils/content'
|
|
|
|
const route = useRoute()
|
|
|
|
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|
|
|
const items = computed(() => mapContentNavigation(navigation?.value.map(item => ({ ...item, children: undefined })) ?? [])?.map(item => ({
|
|
...item,
|
|
active: route.path.startsWith(item.to as string)
|
|
})))
|
|
</script>
|
|
|
|
<template>
|
|
<USeparator class="hidden lg:flex" />
|
|
|
|
<UContainer class="hidden lg:flex items-center justify-between">
|
|
<UNavigationMenu :items="items" variant="pill" highlight class="-mx-2.5 -mb-px" />
|
|
|
|
<FrameworkTabs class="w-40" />
|
|
</UContainer>
|
|
</template>
|