Merge branch '2.x' into dev

This commit is contained in:
chenjiahan
2020-11-21 18:47:31 +08:00
59 changed files with 277 additions and 264 deletions
+14 -7
View File
@@ -119,9 +119,9 @@ export default {
| showIndicators | Whether to show indicators | _boolean_ | `false` |
| loop | Whether to enable loop | _boolean_ | `true` |
| swipeDuration | Animation duration (ms) | _number \| string_ | `500` |
| onClose | Triggered when close | _Function_ | - |
| onChange | Triggered when current image change | _Function_ | - |
| onScale | Triggered when current image scale | _Function_ | - |
| onClose | Emitted when ImagePreview is closed | _Function_ | - |
| onChange | Emitted when current image changed | _Function_ | - |
| onScale | Emitted when scaling current image | _Function_ | - |
| closeOnPopstate | Whether to close when popstate | _boolean_ | `true` |
| beforeClose | Callback function before close | _(action) => boolean \| Promise_ | - |
| className | Custom className | _any_ | - |
@@ -156,10 +156,17 @@ export default {
| Event | Description | Parameters |
| --- | --- | --- |
| close | Triggered when close | { index, url } |
| closed `v2.5.6` | Triggered after closed | - |
| change | Triggered when current image change | index: index of current image |
| scale `v2.5.0` | Triggered when current image scale | { index: index of current image, scale: scale of current image} |
| close | Emitted when closing ImagePreview | { index, url } |
| closed `v2.5.6` | Emitted when ImagePreview is closed | - |
| change | Emitted when current image changed | index: index of current image |
| scale `v2.5.0` | Emitted when scaling current image | { index: index of current image, scale: scale of current image} |
### Methods
Use [ref](https://vuejs.org/v2/api/#ref) to get ImagePreview instance and call instance methods.
| Name | Description | Attribute | Return value |
| --- | --- | --- | --- |
| swipeTo `2.9.0` | Swipe to target index | index: target index, options: Options | - |
### Slots
+8 -1
View File
@@ -201,7 +201,14 @@ export default {
| closed `v2.5.6` | 关闭且且动画结束后触发 | - |
| change | 切换当前图片时触发 | index: 当前图片的索引 |
| scale `v2.5.0` | 缩放当前图片时触发 | { index: 当前图片的索引, scale: 当前缩放的值 } |
| swipeTo `2.9.0` | 切换到指定位置 | index: number, options: Options | - |
### 方法
通过组件调用 `ImagePreview` 时,通过 ref 可以获取到 ImagePreview 实例并调用实例方法,详见[组件实例方法](#/zh-CN/advanced-usage#zu-jian-shi-li-fang-fa)。
| 方法名 | 说明 | 参数 | 返回值 |
| --------------- | -------------- | ------------------------------- | ------ |
| swipeTo `2.9.0` | 切换到指定位置 | index: number, options: Options | - |
### Slots