refactor(components): [collapse] use type-based definitions#23443
Conversation
📝 WalkthroughWalkthroughThis PR refactors the Collapse and CollapseItem components to use explicit type-based prop interfaces instead of ExtractPropTypes. New TypeScript interfaces (CollapseProps, CollapseItemProps) are introduced with JSDoc documentation, ExtractPropTypes is replaced with ExtractPublicPropTypes, and component .vue files are updated to use typed defineProps with default values via withDefaults. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@packages/components/collapse/src/collapse-item.vue`:
- Around line 57-60: The props declaration for CollapseItem (const props =
withDefaults(defineProps<CollapseItemProps>(), ...)) is missing an explicit
default for the disabled prop, causing it to be undefined instead of false;
update the withDefaults call for defineProps<CollapseItemProps>() (the same
place where title and icon defaults are set) to include disabled: false so
:aria-disabled="disabled" renders consistently.
In `@packages/components/collapse/src/collapse.vue`:
- Around line 16-19: The CollapseProps' boolean prop accordion currently has no
explicit default and will be undefined when omitted; update the props defaults
in the withDefaults call (the same place where modelValue and expandIconPosition
are set) to include accordion: false so props.accordion is always a boolean;
locate the const props = withDefaults(defineProps<CollapseProps>(), ...) block
in collapse.vue and add the accordion default entry to that defaults object.
|
🧪 Playground Preview: https://element-plus.run/?pr=23443 |
|
@snowbitx Thanks for your contribution! ❤️ |

Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.ref #23399
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.