docs: add some commonly used props of react-slick to antd documentation (#45789)

This commit is contained in:
afc163 2023-11-11 12:03:39 +08:00 committed by GitHub
parent c73f56e4ea
commit 9db3dc2a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -32,13 +32,17 @@ Common props ref[Common props](/docs/react/common-props)
| Property | Description | Type | Default | Version | | Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| autoplay | Whether to scroll automatically | boolean | false | | | autoplay | Whether to scroll automatically | boolean | false | |
| autoplaySpeed | Delay between each auto scroll (in milliseconds) | number | 3000 | |
| dotPosition | The position of the dots, which can be one of `top` `bottom` `left` `right` | string | `bottom` | | | dotPosition | The position of the dots, which can be one of `top` `bottom` `left` `right` | string | `bottom` | |
| dots | Whether to show the dots at the bottom of the gallery, `object` for `dotsClass` and any others | boolean \| { className?: string } | true | | | dots | Whether to show the dots at the bottom of the gallery, `object` for `dotsClass` and any others | boolean \| { className?: string } | true | |
| waitForAnimate | Whether to wait for the animation when switching | boolean | false | | | fade | Whether to use fade transition | boolean | false | |
| infinite | Infinitely wrap around contents | boolean | true | |
| speed | Animation speed in milliseconds | number | 500 | |
| easing | Transition interpolation function name | string | `linear` | | | easing | Transition interpolation function name | string | `linear` | |
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` | | | effect | Transition effect | `scrollx` \| `fade` | `scrollx` | |
| afterChange | Callback function called after the current index changes | (current: number) => void | - | | | afterChange | Callback function called after the current index changes | (current: number) => void | - | |
| beforeChange | Callback function called before the current index changes | (current: number, next: number) => void | - | | | beforeChange | Callback function called before the current index changes | (current: number, next: number) => void | - | |
| waitForAnimate | Whether to wait for the animation when switching | boolean | false | |
## Methods ## Methods

View File

@ -33,13 +33,17 @@ demo:
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| autoplay | 是否自动切换 | boolean | false | | | autoplay | 是否自动切换 | boolean | false | |
| autoplaySpeed | 自动切换的间隔(毫秒) | number | 3000 | |
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | `bottom` | | | dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | `bottom` | |
| dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?: string } | true | | | dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?: string } | true | |
| waitForAnimate | 是否等待切换动画 | boolean | false | | | fade | 使用渐变切换动效 | boolean | false | |
| infinite | 是否无限循环切换(实现方式是复制两份 children 元素,如果子元素有副作用则可能会引发 bug | boolean | true | |
| speed | 切换动效的时间(毫秒) | number | 500 | |
| easing | 动画效果 | string | `linear` | | | easing | 动画效果 | string | `linear` | |
| effect | 动画效果函数 | `scrollx` \| `fade` | `scrollx` | | | effect | 动画效果函数 | `scrollx` \| `fade` | `scrollx` | |
| afterChange | 切换面板的回调 | (current: number) => void | - | | | afterChange | 切换面板的回调 | (current: number) => void | - | |
| beforeChange | 切换面板的回调 | (current: number, next: number) => void | - | | | beforeChange | 切换面板的回调 | (current: number, next: number) => void | - | |
| waitForAnimate | 是否等待切换动画 | boolean | false | |
## 方法 ## 方法