Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swiper 组件增加对支付宝小程序 onAnimationEnd 事件属性的支持 #7945

Closed
b2nil opened this issue Oct 31, 2020 · 2 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@b2nil
Copy link
Collaborator

b2nil commented Oct 31, 2020

这个特性解决了什么问题?

由于命名差异,目前 Taro 的 Swiper 组件,只支持 onAnimationFinish 事件, 不支持支付宝小程序原生 Swiper 组件的 onAnimationEnd 事件,导致编译至支付宝小程序后,Swiper 组件在动画结束时,无法触发 animationEnd 事件。

例如,Taro UI 的日历组件依赖 onAnimationFinish 来更新月份数据,由于上述问题,该组件在支付宝小程序上不能通过滑动切换月份。

这个 API 长什么样?

仍然采用 onAnimationFinish 命名,但在编译至支付宝小程序后,修改 base.axml 中的 <template name="tmpl_0_swiper"> 基础模板, 将 swiper 节点中的 onAnimationFinish 修改为 onAnimationEnd

编译前:

<Swiper
 ...otherPorps
 onAnimationFinish={handleAnimationFinish}
>
  // ...
</Swiper>

编译后的 base.axml:

<template name="tmpl_0_swiper">
  <swiper
  ...otherProps
  onAnimationEnd="eh"
  >
    ...
  </swiper>
</template>
@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Oct 31, 2020
@Chen-jj Chen-jj modified the milestones: 3.0.16, 3.1.0 Nov 2, 2020
@b2nil
Copy link
Collaborator Author

b2nil commented Nov 4, 2020

支付宝 TextAreashowCount 属性也支持一下吧。

Chen-jj added a commit that referenced this issue Nov 7, 2020
1. Swiper 可以循环最多 4次。
2. 锁定 stencil 小版本
3. 修复支付宝不触发 Swiper 的 onanimationfinish 事件的问题,#7945
@Chen-jj
Copy link
Contributor

Chen-jj commented Nov 7, 2020

3.1 修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants