Skip to content

Commit 57e65e9

Browse files
committed
fix(swiper): keep stop status when window resizing
1 parent 4097015 commit 57e65e9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

components/swiper/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,14 @@ export default {
189189
if (this.__resizeTimeout__) {
190190
clearTimeout(this.__resizeTimeout__)
191191
}
192-
this.stop()
193192
193+
// if swiper stoped originally, keep status
194+
const isStoped = this.isStoped
194195
const startIndex = this.index
196+
!isStoped && this.stop()
195197
this.__resizeTimeout__ = setTimeout(() => {
196198
this.$_reInitItems(startIndex)
197-
this.play(this.duration)
199+
!isStoped && this.play(this.duration)
198200
}, 300)
199201
},
200202
$_onDragStart(e) {

0 commit comments

Comments
 (0)