-
Notifications
You must be signed in to change notification settings - Fork 51
AtCalendar 组件滑动切换月份,意外回到上个月份 #55
Comments
已定位问题, vue.h(components.Swiper, vue.mergeProps(animationEndOrFinish, {
class: 'main__body',
circular: true,
vertical: props.isVertical,
skipHiddenItemLayout: true,
current: 1, // <- 应该改为: currentSwiperIndex.value
onChange: handleChange,
onTouchMove: handleSwipeTouchMove,
onTouchEnd: handleSwipeTouchEnd,
onTouchStart: handleSwipeTouchStart
}), 会在下一个版本中修复。 |
我看 |
你可以试试 react 版本存在这个问题吗? |
把 taro-ui-vue3/dist/index.umd.js 中 AtCalendarBody 中相应的地方按照上面改一下,的确可以修复问题。具体是哪个逻辑,或者 Swiper 组件的问题,后续再研究一下。 |
@whyour
在页面重新渲染后,虽然 <swiper
circular
vertical
:current="1" // <- currentSwiperIndex
@change="handleChange"
>
<swiper-item>
<view class='demo-text-1'>1</view>
</swiper-item>
<swiper-item>
<view class='demo-text-2'>2</view>
</swiper-item>
<swiper-item>
<view class='demo-text-3'>3</view>
</swiper-item>
</swiper>
<view
class="part-loading"
v-if="partLoading"
>
<at-activity-indicator></at-activity-indicator>
</view> const partLoading = ref(false)
const currentSwiperIndex = ref(1)
function handleChange(e) {
const { current, source } = e.detail
if (source === 'touch') {
console.log(current)
// currentSwiperIndex.value = current
partLoading.value = !partLoading.value // 触发页面重新渲染
}
} |
|
|
是的,所以我 |
已发 |
问题描述
当切换月份时,在
monthChange
方法中修改页面中的变量,触发页面重新渲染,这时会又跳到刚才切换之前的月份版本信息
v1.0.0-alpha.12
涉及的平台
weapp
错误信息
无
代码
The text was updated successfully, but these errors were encountered: