Skip to content

Commit

Permalink
fix(h5): onChange 事件添加 source
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuzhang authored and ZakaryCode committed Oct 23, 2023
1 parent 4053f42 commit 5da1481
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/taro-components/src/components/snapshot/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- Auto Generated Below -->

---

_Built with [StencilJS](https://stenciljs.com/)_
----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
12 changes: 11 additions & 1 deletion packages/taro-components/src/components/swiper/swiper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class Swiper implements ComponentInterface {
@State() swiperWrapper: HTMLElement | null
@State() private swiper: ISwiper
@State() isWillLoadCalled = false
@State() source = ''
/**
* 是否显示面板指示点
*/
Expand Down Expand Up @@ -311,10 +312,19 @@ export class Swiper implements ComponentInterface {
}
that.onChange.emit({
current: this.realIndex,
source: ''
source: that.source
})
},
touchEnd: () => {
that.source = 'touch'
},
autoplay() {
that.source = 'autoplay'
},
transitionEnd () {
setTimeout(() => {
that.source = ''
})
that.onAnimationFinish.emit({
current: this.realIndex,
source: ''
Expand Down

0 comments on commit 5da1481

Please sign in to comment.