提交 8d508d93 编写于 作者: D DCloud_LXH 提交者: qiang

fix: swiper 无法滑动的 bug

上级 b1f6508f
...@@ -162,6 +162,7 @@ export default { ...@@ -162,6 +162,7 @@ export default {
mounted () { mounted () {
this._currentCheck() this._currentCheck()
this.touchtrack(this.$refs.slidesWrapper, '_handleContentTrack', true) this.touchtrack(this.$refs.slidesWrapper, '_handleContentTrack', true)
this._resetLayout()
this.$watch(() => { this.$watch(() => {
return this.autoplay && !this.userTracking return this.autoplay && !this.userTracking
}, this._inintAutoplay) }, this._inintAutoplay)
...@@ -486,6 +487,7 @@ export default { ...@@ -486,6 +487,7 @@ export default {
} }
}, },
_handleTrackStart () { _handleTrackStart () {
if (!this.items.length) return
this._cancelSchedule() this._cancelSchedule()
this._contentTrackViewport = this._viewportPosition this._contentTrackViewport = this._viewportPosition
this._contentTrackSpeed = 0 this._contentTrackSpeed = 0
...@@ -493,6 +495,7 @@ export default { ...@@ -493,6 +495,7 @@ export default {
this._cancelViewportAnimation() this._cancelViewportAnimation()
}, },
_handleTrackMove (data) { _handleTrackMove (data) {
if (!this.items.length) return
var self = this var self = this
var contentTrackT = this._contentTrackT var contentTrackT = this._contentTrackT
this._contentTrackT = Date.now() this._contentTrackT = Date.now()
...@@ -527,6 +530,7 @@ export default { ...@@ -527,6 +530,7 @@ export default {
} }
}, },
_handleTrackEnd (isCancel) { _handleTrackEnd (isCancel) {
if (!this.items.length) return
this.userTracking = false this.userTracking = false
var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed) var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed)
var n = 0 var n = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册