diff --git a/src/image-preview/ImagePreviewItem.js b/src/image-preview/ImagePreviewItem.js index c8fb7fbd2..9bc00f044 100644 --- a/src/image-preview/ImagePreviewItem.js +++ b/src/image-preview/ImagePreviewItem.js @@ -94,11 +94,15 @@ export default { }); const setScale = (scale) => { - state.scale = range(scale, +props.minZoom, +props.maxZoom); - emit('scale', { - scale: state.scale, - index: props.active, - }); + scale = range(scale, +props.minZoom, +props.maxZoom); + + if (scale !== state.scale) { + state.scale = scale; + emit('scale', { + scale, + index: props.active, + }); + } }; const resetScale = () => { diff --git a/src/image-preview/README.md b/src/image-preview/README.md index a8af3945f..d463479e7 100644 --- a/src/image-preview/README.md +++ b/src/image-preview/README.md @@ -127,7 +127,7 @@ export default { | showIndex | Whether to show index | _boolean_ | `true` | | showIndicators | Whether to show indicators | _boolean_ | `false` | | loop | Whether to enable loop | _boolean_ | `true` | -| swipeDuration | Animation duration (ms) | _number \| string_ | `500` | +| swipeDuration | Animation duration (ms) | _number \| string_ | `300` | | onClose | Emitted when ImagePreview is closed | _Function_ | - | | onChange | Emitted when current image changed | _Function_ | - | | onScale | Emitted when scaling current image | _Function_ | - | diff --git a/src/image-preview/README.zh-CN.md b/src/image-preview/README.zh-CN.md index 56c944490..1f9d5b688 100644 --- a/src/image-preview/README.zh-CN.md +++ b/src/image-preview/README.zh-CN.md @@ -186,7 +186,7 @@ export default { | --- | --- | --- | --- | | images | 需要预览的图片 URL 数组 | _string[]_ | `[]` | | start-position | 图片预览起始位置索引 | _number \| string_ | `0` | -| swipe-duration | 动画时长,单位为 ms | _number \| string_ | `500` | +| swipe-duration | 动画时长,单位为 ms | _number \| string_ | `300` | | show-index | 是否显示页码 | _boolean_ | `true` | | show-indicators | 是否显示轮播指示器 | _boolean_ | `false` | | loop | 是否开启循环播放 | _boolean_ | `true` |