fix(ImagePreview): missing swipeDuration type definition (#4968)

This commit is contained in:
neverland 2019-11-09 15:57:26 +08:00 committed by GitHub
parent b055980fe0
commit f4f88c5254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -272,8 +272,8 @@ export default createComponent({
ref="swipe"
loop={this.loop}
class={bem('swipe')}
duration={this.swipeDuration}
indicatorColor="white"
duration={this.swipeDuration}
initialSwipe={this.startPosition}
showIndicators={this.showIndicators}
onChange={this.setActive}

View File

@ -107,7 +107,7 @@ export default {
| showIndex | 是否显示页码 | *boolean* | `true` | - |
| showIndicators | 是否显示轮播指示器 | *boolean* | `false` | - |
| loop | 是否开启循环播放 | *boolean* | `true` | - |
| swipeDuration | 动画时长,单位为 ms | *number* | `500` | - |
| swipeDuration | 动画时长,单位为`ms` | *number* | `500` | - |
| onClose | 关闭时的回调函数 | *Function* | - | - |
| onChange | 切换图片时的回调函数,回调参数为当前索引 | *Function* | - | 2.0.3 |
| asyncClose | 是否开启异步关闭 | *boolean* | `false` | - |

View File

@ -5,9 +5,8 @@ import { isServer } from '../utils';
let instance;
const defaultConfig = {
images: [],
loop: true,
swipeDuration: 500,
images: [],
value: true,
minZoom: 1 / 3,
maxZoom: 3,
@ -18,6 +17,7 @@ const defaultConfig = {
showIndex: true,
asyncClose: false,
startPosition: 0,
swipeDuration: 500,
showIndicators: false,
closeOnPopstate: false
};

View File

@ -6,10 +6,11 @@ export type ImagePreviewOptions = string[] | {
maxZoom?: number;
minZoom?: number;
className?: any;
startPosition?: number;
lazyLoad?: boolean;
showIndex?: boolean;
asyncClose?: boolean;
swipeDuration?: number;
startPosition?: number;
showIndicators?: boolean;
closeOnPopstate?: boolean;
onClose?: () => void;