Skip to content

refactor(components): [col] use type-based definitions#23438

Merged
rzzf merged 2 commits into
element-plus:devfrom
lw56777:refactor/col-ComponentProps-#23399
Jan 18, 2026
Merged

refactor(components): [col] use type-based definitions#23438
rzzf merged 2 commits into
element-plus:devfrom
lw56777:refactor/col-ComponentProps-#23399

Conversation

@lw56777
Copy link
Copy Markdown
Contributor

@lw56777 lw56777 commented Jan 18, 2026

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.

修复:#23399

Summary by CodeRabbit

  • Refactor
    • Updated Col component prop type definitions with explicit typing and standardized default values for responsive sizing and layout options, improving consistency and type safety.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

The Col component's prop type definition has been refactored. A new explicit ColProps interface was introduced, ExtractPropTypes was replaced with ExtractPublicPropTypes, and the component now uses type-based defineProps with explicit default values instead of runtime prop objects.

Changes

Cohort / File(s) Summary
Col Component Type Refactoring
packages/components/col/src/col.ts, packages/components/col/src/col.vue
Introduced explicit ColProps interface with tag, span, offset, pull, push, and responsive size properties. Replaced ExtractPropTypes import with ExtractPublicPropTypes. Added deprecation notice to colProps. Component now uses defineProps<ColProps>() with withDefaults for prop initialization instead of runtime prop object.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • element-plus/element-plus#23421: Identical refactor pattern applied to Tag component—introducing explicit interface, removing ExtractPropTypes, adding ExtractPublicPropTypes, and switching to type-based defineProps with withDefaults.
  • element-plus/element-plus#23412: Same refactoring pattern applied across multiple components—establishing consistent prop type definition approach using explicit interfaces and ExtractPublicPropTypes.
  • element-plus/element-plus#23400: Parallel refactor for Affix component following the identical code-level pattern of introducing explicit props interface and switching to type-based defineProps with withDefaults.

Suggested reviewers

  • btea
  • keeplearning66
  • rzzf

Poem

🐰 Hopping through the Col, neat and tidy,
Props now typed, with defaults guided,
ExtractPublicPropTypes takes the lead,
DefineProps blooms where colProps seeded,
Layout components dance with style! 🌸

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: refactoring the col component to use type-based definitions instead of runtime prop objects.
Description check ✅ Passed The description includes all required checklist items checked off and references issue #23399, meeting the template requirements for contributing guide compliance, dev branch target, and issue references.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 18, 2026

Open in StackBlitz

pnpm add https://pkg.pr.new/element-plus/element-plus@23438
npm i https://pkg.pr.new/element-plus/element-plus@23438
yarn add https://pkg.pr.new/element-plus/[email protected]

commit: c81fbfc

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

🧪 Playground Preview: https://element-plus.run/?pr=23438
Please comment the example via this playground if needed.

@rzzf rzzf merged commit 96feb57 into element-plus:dev Jan 18, 2026
17 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

@lw56777 Thanks for your contribution! ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants