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

chore: update type of swiper ref #6437

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions src/components/swiper/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ type PropagationEvent = 'mouseup' | 'mousemove' | 'mousedown'

### Ref

| Name | Description | Type |
| --------- | ----------------------------- | ------------------------- |
| swipeNext | Switch to the next one | `() => void` |
| swipePrev | Switch to the previous one | `() => void` |
| swipeTo | Switch to the specified index | `(index: number) => void` |
| Name | Description | Type |
| --- | --- | --- |
| swipeNext | Switch to the next one | `() => void` |
| swipePrev | Switch to the previous one | `() => void` |
| swipeTo | Switch to the specified index | `(index: number, immediate?: boolean) => void` |

## Swiper.Item

Expand Down
10 changes: 5 additions & 5 deletions src/components/swiper/index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ type PropagationEvent = 'mouseup' | 'mousemove' | 'mousedown'

### Ref

| 属性 | 说明 | 类型 |
| --------- | -------------- | ------------------------- |
| swipeNext | 切换到下一张 | `() => void` |
| swipePrev | 切换到上一张 | `() => void` |
| swipeTo | 切换到指定索引 | `(index: number) => void` |
| 属性 | 说明 | 类型 |
| --------- | -------------- | --------------------------------------------- |
| swipeNext | 切换到下一张 | `() => void` |
| swipePrev | 切换到上一张 | `() => void` |
| swipeTo | 切换到指定索引 | `(index: number, immediate?: boolean) => void` |

## Swiper.Item

Expand Down
2 changes: 1 addition & 1 deletion src/components/swiper/swiper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ValuesToUnion<T, K extends keyof T = keyof T> = K extends keyof T
type PropagationEvent = keyof typeof eventToPropRecord

export type SwiperRef = {
swipeTo: (index: number) => void
swipeTo: (index: number, immediate?: boolean) => void
luo3house marked this conversation as resolved.
Show resolved Hide resolved
swipeNext: () => void
swipePrev: () => void
}
Expand Down
Loading