From 01b7547cccb08ddad94ff21fe5ab1fa3c757e568 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Mon, 13 Jan 2025 16:15:05 +0100 Subject: [PATCH] docs(app): move `watch` before surround --- docs/app/pages/[...slug].vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/app/pages/[...slug].vue b/docs/app/pages/[...slug].vue index 054fbb4864..6dee81943f 100644 --- a/docs/app/pages/[...slug].vue +++ b/docs/app/pages/[...slug].vue @@ -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' : ''}`,