mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-05 14:48:03 +01:00
docs(app): improve header dropdown items
This commit is contained in:
@@ -22,9 +22,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||||
|
|
||||||
const githubLink = computed(() => {
|
const githubLink = computed(() => `https://github.com/nuxt/${value.value}`)
|
||||||
return `https://github.com/nuxt/${value.value}`
|
|
||||||
})
|
|
||||||
|
|
||||||
const desktopLinks = computed(() => props.links.map(({ icon, ...link }) => link))
|
const desktopLinks = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||||
const mobileLinks = computed(() => [
|
const mobileLinks = computed(() => [
|
||||||
@@ -36,6 +34,16 @@ const mobileLinks = computed(() => [
|
|||||||
target: '_blank'
|
target: '_blank'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const items = computed(() => {
|
||||||
|
const ui2 = { label: 'v2.22.0', to: 'https://ui2.nuxt.com' }
|
||||||
|
const uiPro1 = { label: 'v1.8.0', to: 'https://ui2.nuxt.com/pro' }
|
||||||
|
|
||||||
|
return [
|
||||||
|
{ label: `v${config.version}`, active: true, color: 'primary' as const, checked: true, type: 'checkbox' as const },
|
||||||
|
route.path === '/' ? ui2 : route.path.startsWith('/pro') ? uiPro1 : module.value === 'ui-pro' ? uiPro1 : ui2
|
||||||
|
]
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -53,7 +61,7 @@ const mobileLinks = computed(() => [
|
|||||||
<UDropdownMenu
|
<UDropdownMenu
|
||||||
v-slot="{ open }"
|
v-slot="{ open }"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
:items="[{ label: `v${config.version}`, active: true, color: 'primary', checked: true, type: 'checkbox' }, { label: module === 'ui-pro' ? 'v1.8.0' : 'v2.22.0', to: module === 'ui-pro' ? 'https://ui2.nuxt.com/pro' : 'https://ui2.nuxt.com' }]"
|
:items="items"
|
||||||
:ui="{ content: 'w-(--reka-dropdown-menu-trigger-width) min-w-0' }"
|
:ui="{ content: 'w-(--reka-dropdown-menu-trigger-width) min-w-0' }"
|
||||||
size="xs"
|
size="xs"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user