-
-
Notifications
You must be signed in to change notification settings - Fork 334
feat: form表单新增errorType错误提示类型 #487
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- docs/component/form.md (2 hunks)
- src/uni_modules/wot-design-uni/components/wd-form/types.ts (1 hunks)
- src/uni_modules/wot-design-uni/components/wd-form/wd-form.vue (3 hunks)
Additional comments not posted (6)
src/uni_modules/wot-design-uni/components/wd-form/types.ts (1)
63-66: 新增的errorType属性
errorType属性的实现看起来是正确的。使用PropType确保了类型安全,默认值为message适用于大多数使用场景。请确保文档和代码示例中正确展示了该属性的用法。
src/uni_modules/wot-design-uni/components/wd-form/wd-form.vue (3)
4-4: 条件渲染wd-toast组件
wd-toast组件的条件渲染实现看起来是正确的。它确保了只有在errorType为toast时才会渲染该组件。
23-26: 导入和使用useToast
useToast函数的导入和使用看起来是正确的。确保useToast已正确定义并可用。
154-158: 更新showMessage函数
showMessage函数的更新改进了错误处理机制,允许不同的错误显示方式。逻辑看起来是正确的,但请确保toast.show方法已正确定义并按预期行为工作。docs/component/form.md (2)
88-93: 新增errorType属性的文档文档清晰地描述了
errorType属性及其可能的值。请确保示例相关且正确展示了errorType属性的用法。
97-154:errorType属性的示例示例相关且正确展示了
errorType属性的用法。请确保示例完整并准确反映预期用法。
Moonofweisheng
left a comment
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.
在组件内部使用toast组件时,需要指定toast的selector,防止因页面或同页面组件也使用toast导致重复提示的问题。
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 (1)
- src/uni_modules/wot-design-uni/components/wd-form/wd-form.vue (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/uni_modules/wot-design-uni/components/wd-form/wd-form.vue
Moonofweisheng
left a comment
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.
关于新API支持的版本,可以参考贡献指南,使用$LOWEST_VERSION$占位即可,发版时会自动更新。
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 (1)
- docs/component/form.md (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- docs/component/form.md
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新特性
errorType属性,允许选择错误消息的显示方式(如消息、吐司通知或不显示)。文档更新