Skip to content

Commit

Permalink
fix(swiper): keep stop status when window resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyan0205 committed Oct 22, 2019
1 parent 4097015 commit 57e65e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/swiper/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ export default {
if (this.__resizeTimeout__) {
clearTimeout(this.__resizeTimeout__)
}
this.stop()
// if swiper stoped originally, keep status
const isStoped = this.isStoped
const startIndex = this.index
!isStoped && this.stop()
this.__resizeTimeout__ = setTimeout(() => {
this.$_reInitItems(startIndex)
this.play(this.duration)
!isStoped && this.play(this.duration)
}, 300)
},
$_onDragStart(e) {
Expand Down

0 comments on commit 57e65e9

Please sign in to comment.