From c576892ed2a9607f9391e6582e18f527027d5f42 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 19 Dec 2019 18:55:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3swiper=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E8=BF=87=E7=A8=8B=E4=B8=AD=E9=94=80=E6=AF=81=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BC=9A=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20fixed=20#1127?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/swiper/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/view/components/swiper/index.vue b/src/core/view/components/swiper/index.vue index 0cd6b7d76..3a71006a2 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 () { -- GitLab