mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(app): move watch before surround
This commit is contained in:
@@ -14,6 +14,16 @@ if (!page.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
|
||||
}
|
||||
|
||||
// Update the framework/module if the page has different ones
|
||||
watch(page, () => {
|
||||
if (page.value?.framework && page.value?.framework !== framework.value) {
|
||||
framework.value = page.value?.framework as string
|
||||
}
|
||||
if (page.value?.module && page.value?.module !== module.value) {
|
||||
module.value = page.value?.module as string
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
|
||||
return queryCollectionItemSurroundings('content', route.path, {
|
||||
fields: ['description']
|
||||
@@ -53,16 +63,6 @@ if (!import.meta.prerender) {
|
||||
})
|
||||
}
|
||||
|
||||
// Update the framework/module if the page has different ones
|
||||
watch(page, () => {
|
||||
if (page.value?.framework && page.value?.framework !== framework.value) {
|
||||
framework.value = page.value?.framework as string
|
||||
}
|
||||
if (page.value?.module && page.value?.module !== module.value) {
|
||||
module.value = page.value?.module as string
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
const type = page.value?.path.includes('components') ? 'Vue Component ' : page.value?.path.includes('composables') ? 'Vue Composable ' : ''
|
||||
useSeoMeta({
|
||||
titleTemplate: `%s ${type}- Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} v3${page.value.framework === 'vue' ? ' for Vue' : ''}`,
|
||||
|
||||
Reference in New Issue
Block a user