mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 11:20:36 +01:00
docs: don't add pro path if it doesn't exist (#917)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -47,7 +47,7 @@ const navigation = computed(() => {
|
|||||||
const pro = nav.value.find(item => item._path === '/pro')
|
const pro = nav.value.find(item => item._path === '/pro')
|
||||||
|
|
||||||
return [
|
return [
|
||||||
pro,
|
...(pro ? [pro] : []),
|
||||||
...dev
|
...dev
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ const links = computed(() => {
|
|||||||
label: 'Roadmap',
|
label: 'Roadmap',
|
||||||
icon: 'i-heroicons-academic-cap',
|
icon: 'i-heroicons-academic-cap',
|
||||||
to: '/roadmap'
|
to: '/roadmap'
|
||||||
}, {
|
}, !!navigation.value.find(item => item._path === '/pro') && {
|
||||||
label: 'Pro',
|
label: 'Pro',
|
||||||
icon: 'i-heroicons-square-3-stack-3d',
|
icon: 'i-heroicons-square-3-stack-3d',
|
||||||
to: '/pro',
|
to: '/pro',
|
||||||
@@ -110,7 +110,7 @@ const links = computed(() => {
|
|||||||
icon: 'i-heroicons-rocket-launch',
|
icon: 'i-heroicons-rocket-launch',
|
||||||
to: 'https://github.com/nuxt/ui/releases',
|
to: 'https://github.com/nuxt/ui/releases',
|
||||||
target: '_blank'
|
target: '_blank'
|
||||||
}]
|
}].filter(Boolean)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Watch
|
// Watch
|
||||||
|
|||||||
@@ -39,10 +39,17 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', { defa
|
|||||||
// Computed
|
// Computed
|
||||||
|
|
||||||
const navigation = computed(() => {
|
const navigation = computed(() => {
|
||||||
const main = nav.value.filter(item => item._path !== '/dev')
|
if (branch.value?.name === 'dev') {
|
||||||
const dev = nav.value.find(item => item._path === '/dev')?.children
|
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(() => {
|
const links = computed(() => {
|
||||||
@@ -58,7 +65,7 @@ const links = computed(() => {
|
|||||||
label: 'Roadmap',
|
label: 'Roadmap',
|
||||||
icon: 'i-heroicons-academic-cap',
|
icon: 'i-heroicons-academic-cap',
|
||||||
to: '/roadmap'
|
to: '/roadmap'
|
||||||
}, {
|
}, !!navigation.value.find(item => item._path === '/pro') && {
|
||||||
label: 'Pro',
|
label: 'Pro',
|
||||||
icon: 'i-heroicons-square-3-stack-3d',
|
icon: 'i-heroicons-square-3-stack-3d',
|
||||||
to: '/pro',
|
to: '/pro',
|
||||||
@@ -90,7 +97,7 @@ const links = computed(() => {
|
|||||||
icon: 'i-heroicons-rocket-launch',
|
icon: 'i-heroicons-rocket-launch',
|
||||||
to: 'https://github.com/nuxt/ui/releases',
|
to: 'https://github.com/nuxt/ui/releases',
|
||||||
target: '_blank'
|
target: '_blank'
|
||||||
}]
|
}].filter(Boolean)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Provide
|
// Provide
|
||||||
|
|||||||
Reference in New Issue
Block a user