From 4344e366647e9618c21fe800b43d2b4ae2611226 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 7 Jan 2025 15:08:06 +0100 Subject: [PATCH] fix(Accordion/Collapsible/NavigationMenu/Tabs): define `unmountOnHide` default --- src/runtime/components/Accordion.vue | 1 + src/runtime/components/Collapsible.vue | 4 +++- src/runtime/components/NavigationMenu.vue | 4 ++-- src/runtime/components/Tabs.vue | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/runtime/components/Accordion.vue b/src/runtime/components/Accordion.vue index d65a8204..6248db99 100644 --- a/src/runtime/components/Accordion.vue +++ b/src/runtime/components/Accordion.vue @@ -98,6 +98,7 @@ import UIcon from './Icon.vue' const props = withDefaults(defineProps>(), { type: 'single', collapsible: true, + unmountOnHide: true, labelKey: 'label' }) const emits = defineEmits() diff --git a/src/runtime/components/Collapsible.vue b/src/runtime/components/Collapsible.vue index b5c979ae..4c090ecf 100644 --- a/src/runtime/components/Collapsible.vue +++ b/src/runtime/components/Collapsible.vue @@ -34,7 +34,9 @@ extendDevtoolsMeta({ example: 'CollapsibleExample' }) import { CollapsibleRoot, CollapsibleTrigger, CollapsibleContent, useForwardPropsEmits } from 'reka-ui' import { reactivePick } from '@vueuse/core' -const props = defineProps() +const props = withDefaults(defineProps(), { + unmountOnHide: true +}) const emits = defineEmits() const slots = defineSlots() diff --git a/src/runtime/components/NavigationMenu.vue b/src/runtime/components/NavigationMenu.vue index d60f6fd7..80aeb703 100644 --- a/src/runtime/components/NavigationMenu.vue +++ b/src/runtime/components/NavigationMenu.vue @@ -141,8 +141,8 @@ import UCollapsible from './Collapsible.vue' const props = withDefaults(defineProps>(), { orientation: 'horizontal', delayDuration: 0, - labelKey: 'label', - unmountOnHide: true + unmountOnHide: true, + labelKey: 'label' }) const emits = defineEmits() const slots = defineSlots>() diff --git a/src/runtime/components/Tabs.vue b/src/runtime/components/Tabs.vue index 5a2feb32..334dd37b 100644 --- a/src/runtime/components/Tabs.vue +++ b/src/runtime/components/Tabs.vue @@ -96,6 +96,7 @@ const props = withDefaults(defineProps>(), { content: true, defaultValue: '0', orientation: 'horizontal', + unmountOnHide: true, labelKey: 'label' }) const emits = defineEmits()