mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
docs(app): use findPageBreadcrumb from @nuxt/content (#4359)
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
import { kebabCase } from 'scule'
|
import { kebabCase } from 'scule'
|
||||||
import type { ContentNavigationItem } from '@nuxt/content'
|
import type { ContentNavigationItem } from '@nuxt/content'
|
||||||
import type { PageLink } from '@nuxt/ui-pro'
|
import type { PageLink } from '@nuxt/ui-pro'
|
||||||
import { findPageBreadcrumb, mapContentNavigation } from '@nuxt/ui-pro/utils/content'
|
import { mapContentNavigation } from '@nuxt/ui-pro/utils/content'
|
||||||
|
import { findPageBreadcrumb } from '@nuxt/content/utils'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { framework, module } = useSharedData()
|
const { framework, module } = useSharedData()
|
||||||
@@ -37,7 +38,7 @@ const { data: surround } = await useAsyncData(`${kebabCase(route.path)}-surround
|
|||||||
|
|
||||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||||
|
|
||||||
const breadcrumb = computed(() => mapContentNavigation(findPageBreadcrumb(navigation?.value, page.value)).map(({ icon, ...link }) => link))
|
const breadcrumb = computed(() => mapContentNavigation(findPageBreadcrumb(navigation?.value, page.value?.path, { indexAsChild: true })).map(({ icon, ...link }) => link))
|
||||||
|
|
||||||
if (!import.meta.prerender) {
|
if (!import.meta.prerender) {
|
||||||
// Redirect to the correct framework version if the page is not the current framework
|
// Redirect to the correct framework version if the page is not the current framework
|
||||||
|
|||||||
Reference in New Issue
Block a user