mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 05:58:07 +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')
|
||||
|
||||
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
|
||||
|
||||
@@ -39,10 +39,17 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/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
|
||||
|
||||
Reference in New Issue
Block a user