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

fix(comp:carousel): modify onChange params order #863

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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