diff --git a/src/core/view/components/swiper/index.vue b/src/core/view/components/swiper/index.vue index 0cd6b7d761a92344030ec2cf448cb01e1a038e47..3a71006a248a6fb594ab8a8631be2eb5c9d0a894 100644 --- a/src/core/view/components/swiper/index.vue +++ b/src/core/view/components/swiper/index.vue @@ -166,6 +166,7 @@ export default { }, beforeDestroy () { this._cancelSchedule() + cancelAnimationFrame(this._animationFrame) }, methods: { _inintAutoplay (enable) { @@ -421,7 +422,7 @@ export default { var s = acc * time * time / 2 var l = toPos + s this._updateViewport(l) - requestAnimationFrame(this._animateFrameFuncProto.bind(this)) + this._animationFrame = requestAnimationFrame(this._animateFrameFuncProto.bind(this)) }, _animateViewport (current, source, n) { this._cancelViewportAnimation() @@ -464,7 +465,7 @@ export default { } if (!this._requestedAnimation) { this._requestedAnimation = true - requestAnimationFrame(this._animateFrameFuncProto.bind(this)) + this._animationFrame = requestAnimationFrame(this._animateFrameFuncProto.bind(this)) } }, _cancelViewportAnimation () {