提交 8d74161f 编写于 作者: d-u-a's avatar d-u-a

fix(nvue3): swiper

上级 bf39b905
......@@ -142,10 +142,8 @@ function useSwiperListeners(
let lastOffsetRatio: number = 0
const onScroll = (event: any) => {
let offsetRatio = props.vertical
? event.detail.offsetYRatio
: event.detail.offsetXRatio
if (event.drag || event.detail.drag) {
let offsetRatio = props.vertical ? event.offsetYRatio : event.offsetXRatio
if (event.drag || event.drag) {
state.currentChangeSource = 'touch'
}
// 纠正 offsetRatio 数值
......@@ -177,12 +175,11 @@ function useSwiperListeners(
}
}
const onChange = (event: CustomEvent) => {
const detail = event.detail
if (typeof detail.source === 'string') {
state.currentChangeSource = detail.source
const onChange = (event: any) => {
if (typeof event.source === 'string') {
state.currentChangeSource = event.source
}
state.currentSync = detail.index
state.currentSync = event.index
lastOffsetRatio = 0
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册