fix: 🐛 img 图片组件click事件增加mouseEvent参数#539
fix: 🐛 img 图片组件click事件增加mouseEvent参数#539Moonofweisheng merged 1 commit intoMoonofweisheng:masterfrom
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此次更改主要集中在改进 mini-program 中图像组件的事件处理逻辑。文档更新了 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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- docs/component/img.md (1 hunks)
- src/uni_modules/wot-design-uni/components/wd-img/wd-img.vue (2 hunks)
Additional comments not posted (3)
src/uni_modules/wot-design-uni/components/wd-img/wd-img.vue (2)
33-37: 改进事件类型安全性通过使用 TypeScript 泛型定义事件类型,增强了类型安全性和代码的清晰度。这是一个很好的实践。
64-70: 改进点击事件处理
handleClick函数现在接受MouseEvent参数,并传递给emit函数。此更改提高了对事件传播的控制,符合 PR 的目标。建议检查代码库中是否还有其他需要类似更改的地方。
docs/component/img.md (1)
129-129: 更新点击事件文档文档中
click事件的类型签名更新为(event: MouseEvent) => void,提高了开发者使用该事件时的类型安全性和清晰度。
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
无
💡 需求背景和解决方案
方便用户取消图片点击的事件冒泡
解决img组件放在卡片上,给图片添加点击事件时,会触发卡片的点击事件
☑️ 请求合并前的自查清单
Summary by CodeRabbit
文档更新
click事件的描述,增加了事件参数的类型签名,提升了事件预期行为的清晰度和类型安全性。功能增强
wd-img组件中更新了事件发射逻辑,明确了可发射的事件类型,改善了事件处理机制,确保发射的事件携带适当的事件数据。