b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

Alipay 小程序 AtCalendar 滑动时不能更新月份 #22

Closed b2nil closed 4 years ago

b2nil commented 4 years ago

Alipay 小程序 AtCalendar 滑动时不能更新月份。

Taro 的 Swiper 组件只支持 onAnimationFinish 事件属性, 不支持 Alipay 小程序的 onAnimationEnd 事件属性, 因此通过 onAnimationFinish 无法更新月份。

// calendar/body/index.ts
h(Swiper, {
    class: 'main__body',
    ...
    onAnimationFinish: handleAnimateFinish, // <- onAnimationEnd
}, state.listGroup.map((item, key) => (
    h(SwiperItem, {
        ...
    }, [
       ...
    ])
)))
b2nil commented 4 years ago

在 Taro 没有支持支付宝 Swiper 组件的 onAnimationEnd 事件属性之前, 需要对编译后 base.axml 中的 <template name="tmpl_0_swiper"> 基础模板进行手动修改: