-
-
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: ✨Calendar日历添加open事件 #627
Conversation
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 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
Outside diff range and nitpick comments (4)
src/pages/calendar/Index.vue (2)
47-49
: 新的 'open' 事件演示很好,建议稍作改进这个新增的演示块很好地展示了日历组件的 'open' 事件用法。代码实现正确,符合 Vue 3 组合式 API 的最佳实践。
为了增加代码的可读性,建议在
<demo-block>
中添加一个简短的说明文字,解释 'open' 事件的作用。例如:<demo-block transparent title="open事件"> + <view>点击日历输入框时触发open事件</view> <wd-calendar v-model="value17" @open="handleOpen" /> </demo-block>
80-80
: 新增的响应式变量和处理函数实现正确,建议小幅改进新增的
value17
响应式变量和handleOpen
函数实现正确,符合 PR 的目标。handleOpen
函数正确使用了之前导入的message.alert
方法。为了保持代码风格的一致性,建议将
value17
的声明移到其他value
变量声明的位置附近。例如:const value15 = ref<number | null>(null) const value16 = ref<number>(Date.now()) +const value17 = ref<number>(Date.now()) const formatValue = ref<string>('') -const value17 = ref<number>(Date.now())Also applies to: 174-176
src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue (1)
336-336
: 在 open 函数中触发 'open' 事件在
open
函数中触发 'open' 事件的实现是正确的,这样可以在日历打开时通知父组件。考虑在触发事件时传递一些相关的上下文信息,例如:
- emit('open') + emit('open', { timestamp: Date.now() })这样可以为父组件提供更多有用的信息,如日历打开的具体时间戳。
docs/component/calendar.md (1)
420-420
: 新增的 open 事件看起来不错!新增的 open 事件为开发者提供了在日历打开时执行操作的能力,这是一个有用的功能。描述简洁明了。
为了保持文档的一致性,建议考虑添加一个示例代码片段,展示如何使用这个新事件。这将帮助开发者更快地理解和实现这个功能。
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- docs/component/calendar.md (1 hunks)
- src/pages/calendar/Index.vue (3 hunks)
- src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue (2 hunks)
Additional comments not posted (3)
src/pages/calendar/Index.vue (2)
51-51
: 消息框组件添加正确,建议确认放置位置新增的
<wd-message-box />
组件与新的 'open' 事件功能相关,添加合理。请确认将
<wd-message-box />
放置在<page-wraper>
外部是否有特殊考虑?如果没有特殊原因,建议将其移到<page-wraper>
内部,以保持组件结构的一致性。
59-60
: 消息功能导入和设置正确新增的
useMessage
导入和message
常量的创建正确无误,符合 Vue 3 组合式 API 的使用方式。这些更改为新的 'open' 事件功能提供了必要的支持。src/uni_modules/wot-design-uni/components/wd-calendar/wd-calendar.vue (1)
208-208
: 新增 'open' 事件定义新增的 'open' 事件定义符合组件功能扩展的需求,允许父组件监听日历打开的时机。这是一个有用的添加,可以增强组件的灵活性和可用性。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
文档