提交 0af63888 编写于 作者: D DCloud_LXH

fix: swiper switch

上级 6a760fc3
...@@ -296,6 +296,9 @@ function useLayout( ...@@ -296,6 +296,9 @@ function useLayout(
for (; position + length < current; ) { for (; position + length < current; ) {
position += length position += length
} }
if (position + length - current < current - position) {
position += length
}
} else { } else {
for (; position + length < current; ) { for (; position + length < current; ) {
position += length position += length
...@@ -335,9 +338,11 @@ function useLayout( ...@@ -335,9 +338,11 @@ function useLayout(
: 0 : 0
} }
animateViewport(state.current, 'autoplay', circularEnabled.value ? 1 : 0) animateViewport(state.current, 'autoplay', circularEnabled.value ? 1 : 0)
// @ts-ignore setTimeout -> NodeJS.Timeout
timer = setTimeout(callback, state.interval) timer = setTimeout(callback, state.interval)
} }
if (!(invalid || items.length <= state.displayMultipleItems)) { if (!(invalid || items.length <= state.displayMultipleItems)) {
// @ts-ignore setTimeout -> NodeJS.Timeout
timer = setTimeout(callback, state.interval) timer = setTimeout(callback, state.interval)
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册