-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
添加 RadioGroup 组件的 cancelable 属性,支持取消选中功能 #541
base: master
Are you sure you want to change the base?
Conversation
👷 Deploy request for wot-design-uni accepted.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更改引入了一个可取消选择的单选按钮组功能,提升了用户交互体验。新增的Demo块展示了如何使用 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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/pages/radio/Index.vue (1 hunks)
- src/uni_modules/wot-design-uni/components/wd-radio-group/types.ts (2 hunks)
- src/uni_modules/wot-design-uni/components/wd-radio-group/wd-radio-group.vue (1 hunks)
Additional comments not posted (4)
src/uni_modules/wot-design-uni/components/wd-radio-group/types.ts (2)
14-14
: 新增属性cancelable
。在
RadioGroupProvide
类型中添加了可选的cancelable
布尔属性。这为wd-radio-group
提供了取消选中功能的支持。
38-38
: 在radioGroupProps
中添加cancelable
属性。
cancelable
属性的默认值为false
,这意味着默认情况下单选组不允许取消选中。这与预期功能一致。src/uni_modules/wot-design-uni/components/wd-radio-group/wd-radio-group.vue (1)
43-47
: 更新updateValue
函数以支持取消选中功能。当
props.cancelable
为true
且新值与当前modelValue
相同时,函数会发出空字符串,从而允许取消选中。这种实现方式增强了组件的交互性。src/pages/radio/Index.vue (1)
51-61
: 新增可取消选中的演示块。这个演示块展示了如何使用
cancelable
属性来实现可取消选中的单选组功能,提供了一个很好的使用示例。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
boolean
☑️ 请求合并前的自查清单
Summary by CodeRabbit