提交 64ef06ad 编写于 作者: d-u-a's avatar d-u-a 提交者: qiang

fix(nvue3): swiper 事件回调值错误的问题

上级 6a66d752
......@@ -89,8 +89,7 @@ export default defineComponent({
return
}
if (isLabelClick) {
rootRef.value!.click()
return
// TODO
}
checkboxChecked.value = !checkboxChecked.value
uniCheckGroup && uniCheckGroup.checkboxChange($event)
......
......@@ -101,8 +101,7 @@ export default defineComponent({
return
}
if (isLabelClick) {
rootRef.value!.click()
return
// TODO
}
radioChecked.value = !radioChecked.value
uniCheckGroup && uniCheckGroup.radioChange($event, field)
......
......@@ -142,7 +142,10 @@ function useSwiperListeners(
let lastOffsetRatio: number = 0
const onScroll = (event: any) => {
let offsetRatio = props.vertical ? event.offsetYRatio : event.offsetXRatio
const detail = event.detail
const isVertical = props.vertical
let offsetRatio =
(isVertical ? detail.offsetYRatio : detail.offsetXRatio) || 0
if (event.drag || event.drag) {
state.currentChangeSource = 'touch'
}
......@@ -157,8 +160,8 @@ function useSwiperListeners(
}
lastOffsetRatio = offsetRatio
trigger('transition', {
dx: props.vertical ? 0 : -state.swiperWidth * offsetRatio,
dy: props.vertical ? -state.swiperHeight * offsetRatio : 0,
dx: isVertical ? 0 : -state.swiperWidth * offsetRatio,
dy: isVertical ? -state.swiperHeight * offsetRatio : 0,
})
}
......@@ -176,10 +179,10 @@ function useSwiperListeners(
}
const onChange = (event: any) => {
if (typeof event.source === 'string') {
state.currentChangeSource = event.source
if (typeof event.detail.source === 'string') {
state.currentChangeSource = event.detail.source
}
state.currentSync = event.index
state.currentSync = event.detail.index
lastOffsetRatio = 0
}
......
......@@ -57,8 +57,7 @@ export default defineComponent({
return
}
if (isLabelClick) {
rootRef.value!.click()
return
// TODO
}
switchChecked.value = !switchChecked.value
trigger('change', {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册