mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 19:00:35 +01:00
fix(NavigationMenu): only display tooltip when collapsed
This commit is contained in:
@@ -22,6 +22,9 @@ const items = [
|
|||||||
label: 'Documentation',
|
label: 'Documentation',
|
||||||
icon: 'i-lucide-book-open',
|
icon: 'i-lucide-book-open',
|
||||||
badge: 10,
|
badge: 10,
|
||||||
|
tooltip: {
|
||||||
|
text: 'Documentation'
|
||||||
|
},
|
||||||
children: [{
|
children: [{
|
||||||
label: 'Introduction',
|
label: 'Introduction',
|
||||||
description: 'Fully styled and customizable components for Nuxt.',
|
description: 'Fully styled and customizable components for Nuxt.',
|
||||||
@@ -42,9 +45,12 @@ const items = [
|
|||||||
}, {
|
}, {
|
||||||
label: 'Components',
|
label: 'Components',
|
||||||
icon: 'i-lucide-box',
|
icon: 'i-lucide-box',
|
||||||
to: '/components',
|
to: '/components/navigation-menu',
|
||||||
active: true,
|
active: true,
|
||||||
defaultOpen: true,
|
defaultOpen: true,
|
||||||
|
tooltip: {
|
||||||
|
text: 'Components'
|
||||||
|
},
|
||||||
children: [{
|
children: [{
|
||||||
label: 'Link',
|
label: 'Link',
|
||||||
icon: 'i-lucide-link',
|
icon: 'i-lucide-link',
|
||||||
@@ -81,11 +87,17 @@ const items = [
|
|||||||
label: 'GitHub',
|
label: 'GitHub',
|
||||||
icon: 'i-simple-icons-github',
|
icon: 'i-simple-icons-github',
|
||||||
to: 'https://github.com/nuxt/ui',
|
to: 'https://github.com/nuxt/ui',
|
||||||
target: '_blank'
|
target: '_blank',
|
||||||
|
tooltip: {
|
||||||
|
text: 'GitHub'
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
label: 'Help',
|
label: 'Help',
|
||||||
icon: 'i-lucide-circle-help',
|
icon: 'i-lucide-circle-help',
|
||||||
disabled: true
|
disabled: true,
|
||||||
|
tooltip: {
|
||||||
|
text: 'Help'
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -288,8 +288,8 @@ function getAccordionDefaultValue(list: NavigationMenuItem[]) {
|
|||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
@select="item.onSelect"
|
@select="item.onSelect"
|
||||||
>
|
>
|
||||||
<UTooltip v-if="!!item.tooltip" :content="{ side: 'right' }" v-bind="item.tooltip">
|
<UTooltip v-if="!!item.tooltip && orientation === 'vertical' && collapsed" :content="{ side: 'right' }" v-bind="item.tooltip">
|
||||||
<ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active, disabled: !!item.disabled, level: orientation === 'horizontal' || level > 0 })">
|
<ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active, disabled: !!item.disabled, level: level > 0 })">
|
||||||
<ReuseLinkTemplate :item="item" :active="active" :index="index" />
|
<ReuseLinkTemplate :item="item" :active="active" :index="index" />
|
||||||
</ULinkBase>
|
</ULinkBase>
|
||||||
</UTooltip>
|
</UTooltip>
|
||||||
|
|||||||
Reference in New Issue
Block a user