From 3c78e2fd983f19b5cec65b4a94a8a8b14e548e5e Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 20 May 2025 14:36:57 +0200 Subject: [PATCH] fix(NavigationMenu)!: revert new `collapsible` field Reverts https://github.com/nuxt/ui/commit/2be60cddfe10fd1e2466900fd53e21ee0c877227 --- docs/content/3.components/navigation-menu.md | 9 --------- src/runtime/components/NavigationMenu.vue | 17 +++++------------ .../NavigationMenu-vue.spec.ts.snap | 10 ++-------- .../__snapshots__/NavigationMenu.spec.ts.snap | 10 ++-------- 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/docs/content/3.components/navigation-menu.md b/docs/content/3.components/navigation-menu.md index d5179692..64c7dde2 100644 --- a/docs/content/3.components/navigation-menu.md +++ b/docs/content/3.components/navigation-menu.md @@ -24,7 +24,6 @@ Use the `items` prop as an array of objects with the following properties: - `tooltip?: TooltipProps`{lang="ts-type"} - `trailingIcon?: string`{lang="ts-type"} - `type?: 'label' | 'link'`{lang="ts-type"} -- `collapsible?: boolean`{lang="ts-type"} - `defaultOpen?: boolean`{lang="ts-type"} - `open?: boolean`{lang="ts-type"} - `value?: string`{lang="ts-type"} @@ -283,7 +282,6 @@ props: description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.' - label: Composables icon: i-lucide-database - collapsible: false open: false children: - label: defineShortcuts @@ -300,7 +298,6 @@ props: to: /composables/use-toast - label: Components icon: i-lucide-box - collapsible: false open: false to: /components active: true @@ -340,10 +337,6 @@ props: --- :: -::tip -You can set the `collapsible: false` property on items with children to prevent them from being collapsible. This allows the item to act as a regular link while still displaying its children in a submenu. -:: - ### Highlight Use the `highlight` prop to display a highlighted border for the active item. @@ -940,7 +933,6 @@ props: icon: i-lucide-database tooltip: text: 'Composables' - collapsible: false open: false children: - label: defineShortcuts @@ -961,7 +953,6 @@ props: text: 'Components' to: /components active: true - collapsible: false open: false children: - label: Link diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index 1ca6530a..cb62cae1 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -48,12 +48,6 @@ export interface NavigationMenuItem extends Omit(() => :class="ui.linkTrailingBadge({ class: [props.ui?.linkTrailingBadge, item.ui?.linkTrailingBadge] })" /> - + @@ -257,18 +251,17 @@ const lists = computed(() =>
- + (() => -