fix(Collapse): animate invalid on multi clicks #4567
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
无反应
#4422
#4068
缓慢
#4523
#4111
问题描述
此类问题应该只在使用 小程序基础库
v2.9.0
以上的小程序上出现原因分析
应该是微信新提供的
this.animate
和旧版的wx.createAnimation
存在差异。主要差异应该是
this.animate
内部应该是队列形式,必须要执行完上一个动画才可以,而wx.createAnimation
实际是生成动画样式,然后塞到dom中,可以进行强行中断当前动画塞入新动画。其他尝试
this.animate
时判断当前是否正在进行动画,如果有则调用this.clearAnimation
。但是效果并不理想,会有闪烁出现猜测的结论
所以像这种快速点击(多次中断当前动画)的场景
this.animate
可能无法满足