-
-
Notifications
You must be signed in to change notification settings - Fork 190
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: ✨ DatetimePicker 支持自定义icon(#861) #872
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
变更概览演练这个拉取请求主要增强了日期时间选择器组件的自定义能力。文档中新增了两个部分:自定义图标和自定义展示文案。在示例页面中,添加了一个可清空的日期时间选择器,通过计算属性和方法实现了图标的动态渲染和清空功能。组件本身也进行了修改,使图标渲染更加灵活。 变更
可能相关的PR
建议的审阅者
诗歌
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for wot-design-uni ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
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
🧹 Nitpick comments (3)
src/pages/datetimePicker/Index.vue (1)
72-72
: 建议优化清除功能的实现。当前实现在清除时直接设置空字符串,建议考虑以下几点改进:
- 考虑添加清除前的确认机制
- 考虑触发 change 事件通知父组件
建议修改如下:
const clear = () => { if (iconName.value === 'arrow-right') { return } value18.value = '' + emit('change', { value: '' }) }
Also applies to: 77-87
docs/component/datetime-picker.md (2)
255-279
: 文档示例完整,建议补充更多使用场景。自定义图标的文档说明清晰,建议补充以下内容:
- 添加更多使用场景的示例,如不同状态下的图标展示
- 补充图标点击事件的防抖处理建议
371-371
: API 文档完善,建议优化参数说明。插槽参数说明简洁明了,建议补充:
- 详细的类型定义说明
- 更多的使用示例链接
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/component/datetime-picker.md
(2 hunks)src/pages/datetimePicker/Index.vue
(3 hunks)src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue
(1 hunks)
🔇 Additional comments (2)
src/pages/datetimePicker/Index.vue (1)
36-42
: 代码结构清晰,实现了可清空的日期时间选择器。组件结构合理,通过插槽实现了自定义图标功能。
src/uni_modules/wot-design-uni/components/wd-datetime-picker/wd-datetime-picker.vue (1)
41-43
: 插槽实现灵活,保持了良好的向后兼容性。通过默认插槽内容保证了未使用自定义图标时的默认行为,同时向插槽传递了必要的状态属性。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新特性
文档更新
功能增强