-
-
Notifications
You must be signed in to change notification settings - Fork 317
fix: 🐛 修复wd-text text 属性接受Number类型控制台警告的问题 #553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for wot-design-uni ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改涉及对 Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- docs/component/text.md (1 hunks)
- src/uni_modules/wot-design-uni/components/wd-text/types.ts (2 hunks)
- src/uni_modules/wot-design-uni/components/wd-text/wd-text.vue (1 hunks)
Additional comments not posted (2)
src/uni_modules/wot-design-uni/components/wd-text/wd-text.vue (1)
127-127: 更改已批准。将
text显式转换为字符串,以确保格式化函数处理正确的数据类型。docs/component/text.md (1)
152-152: 文档更改已批准。
text参数类型更新为string / number,以反映代码中的更改。
| * 类型:string | string | ||
| * 默认值:'空字符串' | ||
| */ | ||
| text: makeStringProp(''), | ||
| text: makeNumericProp(''), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
更新文档注释以反映类型更改。
注释中的类型描述应更新为 string | number,以匹配代码中的更改。
请应用以下更改:
/**
* 文字
- * 类型:string | string
+ * 类型:string | number
* 默认值:'空字符串'
*/Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * 类型:string | string | |
| * 默认值:'空字符串' | |
| */ | |
| text: makeStringProp(''), | |
| text: makeNumericProp(''), | |
| /** | |
| * 文字 | |
| * 类型:string | number | |
| * 默认值:'空字符串' | |
| */ | |
| text: makeNumericProp(''), |
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
clickTest函数文档,允许text参数接受字符串和数字,增强输入灵活性。wd-text组件的text属性类型从字符串更改为数字,支持数字作为文本内容。wd-text组件的文档,以反映text属性的类型变化。wd-text组件中的formattedText计算属性,确保text在传递给formatText函数前被转换为字符串,提高了组件的可靠性。