Skip to content

Conversation

benjamincanac
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

pkg-pr-new bot commented Oct 16, 2025

npm i https://pkg.pr.new/@nuxt/ui@5207

commit: 2fc4e0d

export type AccordionSlots<T extends AccordionItem = AccordionItem> = {
leading: SlotProps<T>
default: SlotProps<T>
default(props: { item: T, index: number, open: boolean }): any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default slot in AccordionSlots is missing the ui prop that was added to all other slots in this refactoring.

View Details
πŸ“ Patch Details
diff --git a/src/runtime/components/Accordion.vue b/src/runtime/components/Accordion.vue
index 70a6f0c9..251c027d 100644
--- a/src/runtime/components/Accordion.vue
+++ b/src/runtime/components/Accordion.vue
@@ -57,7 +57,7 @@ type SlotProps<T extends AccordionItem> = (props: { item: T, index: number, open
 
 export type AccordionSlots<T extends AccordionItem = AccordionItem> = {
   leading: SlotProps<T>
-  default(props: { item: T, index: number, open: boolean }): any
+  default: SlotProps<T>
   trailing: SlotProps<T>
   content: SlotProps<T>
   body: SlotProps<T>
@@ -109,7 +109,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.accordion ||
           </slot>
 
           <span v-if="get(item, props.labelKey as string) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
-            <slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey as string) }}</slot>
+            <slot :item="item" :index="index" :open="open" :ui="ui">{{ get(item, props.labelKey as string) }}</slot>
           </span>
 
           <slot name="trailing" :item="item" :index="index" :open="open" :ui="ui">

Analysis

Accordion default slot missing ui prop in type definition and template

What fails: AccordionSlots default slot type definition uses inline type { item: T, index: number, open: boolean } instead of SlotProps<T>, missing the ui prop that all other slots provide. Template also doesn't pass :ui="ui" to default slot.

How to reproduce:

 </div> // TypeScript error: ui doesn't exist
</template>

Result: TypeScript error - Property 'ui' does not exist on type '{ item: T; index: number; open: boolean; }'

Expected: Default slot should have same ui prop as leading/trailing/content/body slots per SlotProps type definition in line 56, and template should pass :ui="ui" consistently like other slots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant