Skip to content

Conversation

@RSS1102
Copy link
Collaborator

@RSS1102 RSS1102 commented Oct 23, 2025

Swiper 组件内有一个 api 为 cardScale 类型为 Number 默认值为 210/332

@liweijie0812
Copy link
Member

liweijie0812 commented Oct 24, 2025

image react的看起来还要改下

@RSS1102 RSS1102 marked this pull request as draft October 24, 2025 02:13
@RSS1102 RSS1102 marked this pull request as ready for review October 28, 2025 01:24
@RSS1102
Copy link
Collaborator Author

RSS1102 commented Oct 28, 2025

@liweijie0812 帮忙看下

@RSS1102 RSS1102 changed the title fix: 支持分数形式的默认值配置 fix: Number 类型支持分数形式的默认值配置 Oct 28, 2025
@liweijie0812 liweijie0812 requested a review from Copilot October 28, 2025 03:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for fraction-formatted default values (e.g., 210/332) for Number type properties. The change enables the Swiper component's cardScale API to accept a fraction as its default value while maintaining backward compatibility with standard numeric defaults.

Key changes:

  • Enhanced type generation scripts to detect and preserve fraction-formatted default values for Number types
  • Updated Swiper component props across Vue 2, Vue 3, and React to use the fraction format 210/332 for cardScale

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/scripts/types/vue-props.js Added regex pattern matching to detect fraction format and preserve it as-is for Number types
packages/scripts/types/react-default-props.js Added similar fraction detection logic for React default props generation
packages/products/tdesign-vue/src/swiper/props.ts Added default value 210/332 (evaluated as number) to cardScale prop
packages/products/tdesign-vue-next/packages/components/swiper/props.ts Added default value 210/332 (evaluated as number) to cardScale prop
packages/products/tdesign-react/packages/components/swiper/defaultProps.ts Changed cardScale from string '210/332' to evaluated number 210 / 332
Comments suppressed due to low confidence (1)

packages/scripts/types/react-default-props.js:1

  • Corrected spacing in comment: '其它数字类型,按数值处理' should have a space after the comma: '其它数字类型, 按数值处理'.
/**

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RSS1102 RSS1102 changed the title fix: Number 类型支持分数形式的默认值配置 fix: Number 类型支持分数形式的默认值配置 Oct 28, 2025
@liweijie0812 liweijie0812 merged commit b604a33 into main Oct 28, 2025
4 checks passed
@liweijie0812 liweijie0812 deleted the rss1102/fix/type-number/fraction branch October 28, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants