Skip to content

Commit

Permalink
fix(comp:carousel): modify onChange params order
Browse files Browse the repository at this point in the history
  • Loading branch information
brenner8023 committed Apr 25, 2022
1 parent 50fb584 commit c3aaf95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/components/carousel/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ order: 0
| `dotPlacement` | 面板指示点的位置 | `'top' \| 'start' \| 'bottom' \| 'end' \| 'none'` | `'bottom'` ||`'none'`时不显示面板指示点 |
| `showArrow` | 是否显示`prev``next`按钮 | `boolean` | `false` || - |
| `trigger` | 面板指示点的触发方式 | `'click' \| 'hover'` | `'click'` || - |
| `onChange` | 面板切换时会触发的回调函数 | `(prevIndex: number, nextIndex: number) => void` | - | - | - |
| `onChange` | 面板切换时会触发的回调函数 | `(nextIndex: number, prevIndex: number) => void` | - | - | - |

#### CarouselSlots

Expand Down Expand Up @@ -55,4 +55,4 @@ order: 0
| `@carousel-icon-opacity` | `0.3` | - | - |
| `@carousel-icon-hover-opacity` | `0.6` | - | - |
| `@carousel-icon-active-opacity` | `0.8` | - | - |
<!--- insert less variable end --->
<!--- insert less variable end --->
2 changes: 1 addition & 1 deletion packages/components/carousel/src/composables/useWalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const useWalk = (length: ComputedRef<number>, props: CarouselProps): Walk

watch(activeIndex, (newVal: number, oldVal: number) => {
if (newVal >= 1 && newVal <= length.value) {
callEmit(props.onChange, oldVal, newVal)
callEmit(props.onChange, newVal, oldVal)
}
})

Expand Down

0 comments on commit c3aaf95

Please sign in to comment.