feat(Switch): add shape api for web#914
Open
Seeridia wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new shape API to the Switch component surface area for web frameworks in this repo (Vue, Vue Next, React), aligning type definitions, runtime prop definitions (where applicable), and generated API docs.
Changes:
- Add
shape?: 'circle' | 'round' | 'line'to Switch TS prop types (Vue/Vue Next/React). - Add
shapeto Vue/Vue Next Switch prop definitions with defaultcircleand an options validator. - Document
shapein Switch markdown tables (CN/EN), including the note thatlabelis not rendered whenshape="line".
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/products/tdesign-vue/src/switch/type.ts | Adds shape to Vue Switch prop TS interface. |
| packages/products/tdesign-vue/src/switch/switch.md | Documents shape in Vue CN API table. |
| packages/products/tdesign-vue/src/switch/switch.en-US.md | Documents shape in Vue EN API table. |
| packages/products/tdesign-vue/src/switch/props.ts | Adds Vue runtime prop definition for shape (default + validator). |
| packages/products/tdesign-vue-next/packages/components/switch/type.ts | Adds shape to Vue Next Switch prop TS interface. |
| packages/products/tdesign-vue-next/packages/components/switch/switch.md | Documents shape in Vue Next CN API table. |
| packages/products/tdesign-vue-next/packages/components/switch/switch.en-US.md | Documents shape in Vue Next EN API table. |
| packages/products/tdesign-vue-next/packages/components/switch/props.ts | Adds Vue Next runtime prop definition for shape (default + validator). |
| packages/products/tdesign-vue-next/examples/switch/switch.md | Updates Vue Next examples API table to include shape. |
| packages/products/tdesign-vue-next/examples/switch/switch.en-US.md | Updates Vue Next examples EN API table to include shape. |
| packages/products/tdesign-react/packages/components/switch/type.ts | Adds shape to React Switch prop TS interface. |
| packages/products/tdesign-react/packages/components/switch/switch.md | Documents shape in React CN API table. |
| packages/products/tdesign-react/packages/components/switch/switch.en-US.md | Documents shape in React EN API table. |
| packages/products/tdesign-react/packages/components/switch/defaultProps.ts | Adds shape: 'circle' to React Switch default props. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为 Switch 新增
shapeAPI,用于支持三种形态:circle: 默认胶囊形,保持当前视觉不变。round: 圆角矩形形态。line: 线性形态。相关 PR:
设计稿:https://www.figma.com/design/r9jPY6A4EUDvEdoWQ1LVxe/TDesign-for-web--Community----Select?node-id=45757-378235&t=5X597ofKeSefwy0q-1