diff --git a/src/core/view/components/swiper/index.vue b/src/core/view/components/swiper/index.vue index 0f6eb52c3a0de5b89d588ab414717c12b789ff3f..e5ec90db115f6a85c7bb5924b3ef8a727225e85a 100644 --- a/src/core/view/components/swiper/index.vue +++ b/src/core/view/components/swiper/index.vue @@ -162,6 +162,7 @@ export default { mounted () { this._currentCheck() this.touchtrack(this.$refs.slidesWrapper, '_handleContentTrack', true) + this._resetLayout() this.$watch(() => { return this.autoplay && !this.userTracking }, this._inintAutoplay) @@ -486,6 +487,7 @@ export default { } }, _handleTrackStart () { + if (!this.items.length) return this._cancelSchedule() this._contentTrackViewport = this._viewportPosition this._contentTrackSpeed = 0 @@ -493,6 +495,7 @@ export default { this._cancelViewportAnimation() }, _handleTrackMove (data) { + if (!this.items.length) return var self = this var contentTrackT = this._contentTrackT this._contentTrackT = Date.now() @@ -527,6 +530,7 @@ export default { } }, _handleTrackEnd (isCancel) { + if (!this.items.length) return this.userTracking = false var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed) var n = 0