diff --git a/docs/app/components/content/ComponentCode.vue b/docs/app/components/content/ComponentCode.vue index 1b2c4441b5..7050378460 100644 --- a/docs/app/components/content/ComponentCode.vue +++ b/docs/app/components/content/ComponentCode.vue @@ -239,23 +239,23 @@ ${props.slots?.default} } const prop = meta?.meta?.props?.find((prop: any) => prop.name === key) + const propDefault = prop && (prop.default ?? prop.tags?.find(tag => tag.name === 'defaultValue')?.text ?? componentTheme?.defaultVariants?.[prop.name]) const name = kebabCase(key) if (typeof value === 'boolean') { - if (value && prop?.default === 'true') { + if (value && (propDefault === 'true' || propDefault === '`true`' || propDefault === true)) { continue } - if (!value && (!prop?.default || prop.default === 'false')) { + if (!value && (!propDefault || propDefault === 'false' || propDefault === '`false`' || propDefault === false)) { continue } - code += value ? ` ${name}` : ` :${key}="false"` + code += value ? ` ${name}` : ` :${name}="false"` } else if (typeof value === 'object') { const parsedValue = !props.external?.includes(key) ? json5.stringify(value, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1') : key code += ` :${name}="${parsedValue}"` } else { - const propDefault = prop && (prop.default ?? prop.tags?.find(tag => tag.name === 'defaultValue')?.text ?? componentTheme?.defaultVariants?.[prop.name]) if (propDefault === value) { continue } diff --git a/src/runtime/components/Accordion.vue b/src/runtime/components/Accordion.vue index d65a8204d1..6248db9919 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 b5c979aed3..4c090ecf3c 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 d60f6fd721..80aeb70311 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 5a2feb320a..334dd37be0 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()