diff --git a/docs/app.vue b/docs/app.vue index 759f07df38..7ec9754a84 100644 --- a/docs/app.vue +++ b/docs/app.vue @@ -47,7 +47,7 @@ const navigation = computed(() => { const pro = nav.value.find(item => item._path === '/pro') return [ - pro, + ...(pro ? [pro] : []), ...dev ] } @@ -78,7 +78,7 @@ const links = computed(() => { label: 'Roadmap', icon: 'i-heroicons-academic-cap', to: '/roadmap' - }, { + }, !!navigation.value.find(item => item._path === '/pro') && { label: 'Pro', icon: 'i-heroicons-square-3-stack-3d', to: '/pro', @@ -110,7 +110,7 @@ const links = computed(() => { icon: 'i-heroicons-rocket-launch', to: 'https://github.com/nuxt/ui/releases', target: '_blank' - }] + }].filter(Boolean) }) // Watch diff --git a/docs/error.vue b/docs/error.vue index 84c4ad4e4b..f4ce367537 100644 --- a/docs/error.vue +++ b/docs/error.vue @@ -39,10 +39,17 @@ const { data: files } = useLazyFetch('/api/search.json', { defa // Computed const navigation = computed(() => { - const main = nav.value.filter(item => item._path !== '/dev') - const dev = nav.value.find(item => item._path === '/dev')?.children + if (branch.value?.name === 'dev') { + const dev = nav.value.find(item => item._path === '/dev')?.children + const pro = nav.value.find(item => item._path === '/pro') - return branch.value?.name === 'dev' ? dev : main + return [ + ...(pro ? [pro] : []), + ...dev + ] + } + + return nav.value.filter(item => item._path !== '/dev') }) const links = computed(() => { @@ -58,7 +65,7 @@ const links = computed(() => { label: 'Roadmap', icon: 'i-heroicons-academic-cap', to: '/roadmap' - }, { + }, !!navigation.value.find(item => item._path === '/pro') && { label: 'Pro', icon: 'i-heroicons-square-3-stack-3d', to: '/pro', @@ -90,7 +97,7 @@ const links = computed(() => { icon: 'i-heroicons-rocket-launch', to: 'https://github.com/nuxt/ui/releases', target: '_blank' - }] + }].filter(Boolean) }) // Provide