refactor(components): [badge/breadcrumb/button] use type-based definitions#23414
Conversation
📝 WalkthroughWalkthroughAdds explicit exported TypeScript prop interfaces for Badge, Breadcrumb, and Button (and related items), deprecates ExtractPropTypes-based public aliases, updates SFCs to use type-only imports with defineProps() plus withDefaults(...), and adjusts some prop types/defaults and docs (badge offset). Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ 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: |
|
🧪 Playground Preview: https://element-plus.run/?pr=23414 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/components/button/src/button.vue`:
- Around line 30-49: The Button booleans (disabled, plain, text, round,
autoInsertSpace) are now defaulting to false via withDefaults, breaking
use-button's nullish-coalescing fallback to globalConfig; update the props
declaration (the withDefaults call in button.vue where ButtonProps/props is
defined) to explicitly set those boolean props to undefined (restore tri-state
defaults) so useButton (use-button.ts) can detect undefined and fall back to
globalConfig.value, or alternately adjust useButton's merge logic to treat false
as a valid value only when explicitly specified (e.g., check prop === undefined
before using globalConfig).
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@docs/en-US/component/badge.md`:
- Around line 62-73: Update the docs table row for the prop offset (referenced
as "offset ^(2.7.0)") so its Default cell matches the runtime default of [0, 0]
instead of "—"; locate the offset row in the badge props table and replace the
placeholder default with the literal "[0, 0]" (keeping existing formatting style
consistent with other default values).
🧹 Nitpick comments (1)
packages/components/badge/src/badge.vue (1)
30-46: Consider centralizing defaults to avoid driftDefaults now live both here and in
badgeProps. A sharedbadgeDefaultsexport could prevent divergence over time.
|
Hello, @snowbitx, your PR title does not meet the standards, please refer to here. |
Co-authored-by: rzzf <[email protected]>
Co-authored-by: rzzf <[email protected]>
rzzf
left a comment
There was a problem hiding this comment.
Thanks for all the back-and-forth
|
@snowbitx Thanks for your contribution! ❤️ |
relate comment |


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