-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: ✨ count-to组件添加type属性 #556
feat: ✨ count-to组件添加type属性 #556
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
Sequence Diagram(s)sequenceDiagram
participant User
participant wd-count-to
participant wd-text
User->>wd-count-to: 设置组件属性(type)
wd-count-to->>wd-text: 传递文本和类型
wd-text->>User: 渲染带有主题样式的文本
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: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- docs/component/count-to.md (2 hunks)
- docs/component/text.md (1 hunks)
- src/pages/countTo/Index.vue (1 hunks)
- src/uni_modules/wot-design-uni/components/wd-count-to/types.ts (2 hunks)
- src/uni_modules/wot-design-uni/components/wd-count-to/wd-count-to.vue (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 (7)
src/uni_modules/wot-design-uni/components/wd-count-to/types.ts (1)
13-19
: 新增type
属性的更改已批准。
type
属性的添加增强了组件的可配置性,并与预定义的文本类型保持一致。src/pages/countTo/Index.vue (1)
10-16
: 新增的演示块已批准。新的演示块有效地展示了
wd-count-to
组件的type
属性,为用户提供了视觉示例。src/uni_modules/wot-design-uni/components/wd-text/wd-text.vue (1)
127-127
: 更改已批准:确保文本类型一致性将
text
转换为字符串以确保类型一致性是一个很好的做法,可以防止潜在的类型错误。src/uni_modules/wot-design-uni/components/wd-count-to/wd-count-to.vue (1)
5-13
: 更改已批准:增强的灵活性通过在
<wd-text>
组件中添加:type
属性,增强了组件的灵活性,使其能够根据指定类型调整渲染。docs/component/text.md (1)
152-152
: 更改已批准:增强的参数灵活性将
text
参数类型从string
更改为string / number
提高了灵活性,允许接受数字值。docs/component/count-to.md (2)
78-92
: 属性表更新良好
type
参数的添加清晰且一致,默认值和可选值已正确指定。
Line range hint
1-122
: 文档结构和格式改进良好整体结构和格式的改进提高了可读性,并在各个部分保持了一致性。
* 类型: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 | string
,这似乎是一个错误。考虑到 makeNumericProp
的使用,类型应该是 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(''), |
## 设置主题 | ||
|
||
通过<code>type</code>参数设置文本主题,我们提供了五类属性:<code>primary</code> <code>error</code> <code>success</code> <code>warning</code> <code>default-默认</code>。 | ||
|
||
```html | ||
<wd-count-to type="primary" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="error" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="success" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="warning" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="info" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
``` |
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.
修正示例中的info
类型
在设置主题部分,info
类型不在提供的五种属性中。请确认是否需要添加或删除该示例。
如果info
类型是有效的,请更新文档以包含该选项;否则,请移除示例中的info
类型。
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.
@wyl086 此处确实如rabbit所说,info类型不在提供的五种属性中。
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
437eddc
to
2a26381
Compare
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- docs/component/count-to.md (2 hunks)
- src/pages/countTo/Index.vue (1 hunks)
- src/uni_modules/wot-design-uni/components/wd-count-to/types.ts (2 hunks)
- src/uni_modules/wot-design-uni/components/wd-count-to/wd-count-to.vue (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- docs/component/count-to.md
- src/pages/countTo/Index.vue
- src/uni_modules/wot-design-uni/components/wd-count-to/types.ts
- src/uni_modules/wot-design-uni/components/wd-count-to/wd-count-to.vue
## 设置主题 | ||
|
||
通过<code>type</code>参数设置文本主题,我们提供了五类属性:<code>primary</code> <code>error</code> <code>success</code> <code>warning</code> <code>default-默认</code>。 | ||
|
||
```html | ||
<wd-count-to type="primary" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="error" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="success" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="warning" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
<wd-count-to type="info" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to> | ||
``` |
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.
@wyl086 此处确实如rabbit所说,info类型不在提供的五种属性中。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
wd-count-to
组件文档,新增type
参数,以支持多种文本主题(primary
、error
、success
、warning
、default
)。wd-count-to
组件用法。文档