From 6303702db0f113b959edba71bd5f5966b8cc580f Mon Sep 17 00:00:00 2001 From: lichunqiang Date: Fri, 27 Jul 2018 15:52:33 +0800 Subject: [PATCH] fix swiper auto --- src/components/swiper/swiper.js | 3 +++ src/components/swiper/swiper.vue | 1 + 2 files changed, 4 insertions(+) diff --git a/src/components/swiper/swiper.js b/src/components/swiper/swiper.js index 152af99cb..9cb8581a9 100755 --- a/src/components/swiper/swiper.js +++ b/src/components/swiper/swiper.js @@ -42,6 +42,9 @@ class Swiper { this._onResize() return this } + setOptions (newOptions = {}) { + this._options = objectAssign(this._options, newOptions) + } _auto () { const me = this diff --git a/src/components/swiper/swiper.vue b/src/components/swiper/swiper.vue index 47e10e09e..5c258002a 100755 --- a/src/components/swiper/swiper.vue +++ b/src/components/swiper/swiper.vue @@ -187,6 +187,7 @@ export default { }, watch: { auto (val) { + this.swiper && this.swiper.setOptions({auto: val}) if (!val) { this.swiper && this.swiper.stop() } else {