fix: 🐛 修复 wd-img-cropper 组件在微信小程序中旋转图片后操作卡顿的问题 - #1112
Conversation
✅ Deploy Preview for wot-design-uni ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次更改调整了 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant wd-img-cropper.vue
User->>wd-img-cropper.vue: 调用 setAnimation()
wd-img-cropper.vue->>wd-img-cropper.vue: 调用 revertIsAnimation({value: false})
wd-img-cropper.vue->>wd-img-cropper.vue: 判断参数类型并设置 isAnimation.value
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1112 +/- ##
===========================================
+ Coverage 52.18% 85.27% +33.09%
===========================================
Files 11 7 -4
Lines 962 686 -276
Branches 94 107 +13
===========================================
+ Hits 502 585 +83
+ Misses 460 101 -359
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🤔 这个 PR 的性质是?(至少选择一个)
🔗 相关 Issue
💡 需求背景和解决方案
在微信小程序环境下使用 wd-img-cropper 组件,将图片旋转90度或270度后,可复现此 bug,手势操作会变得卡顿。
检查 dom 发现,image 元素的 transition-duration 属性在不断发生变化,造成的实际体验效果就是手势操作卡顿:
断点发现 revertIsAnimation 不断被调用,且其中一次接收到的值为空对象 {}:
排查发现接收空对象的那次调用来自 wxs 中的
ownerInstance.callMethod('revertIsAnimation',false),查看微信官方文档https://developers.weixin.qq.com/miniprogram/dev/framework/view/interactive-animation.html,可以看到 callMethod 的第二个参数只能为 object 类型
解决方案是扩大 revertIsAnimation 可接收参数的类型,兼容对象类型参数,对 wxs 中的调用进行特殊处理。
☑️ 请求合并前的自查清单
Summary by CodeRabbit