mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Calendar): should not emit scale event when scale not changed (#7975)
* fix(Calendar): should not emit scale event when scale not changed * chore: update
This commit is contained in:
parent
598fd4a464
commit
93298ec3b7
@ -94,11 +94,15 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const setScale = (scale) => {
|
const setScale = (scale) => {
|
||||||
state.scale = range(scale, +props.minZoom, +props.maxZoom);
|
scale = range(scale, +props.minZoom, +props.maxZoom);
|
||||||
emit('scale', {
|
|
||||||
scale: state.scale,
|
if (scale !== state.scale) {
|
||||||
index: props.active,
|
state.scale = scale;
|
||||||
});
|
emit('scale', {
|
||||||
|
scale,
|
||||||
|
index: props.active,
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const resetScale = () => {
|
const resetScale = () => {
|
||||||
|
@ -127,7 +127,7 @@ export default {
|
|||||||
| showIndex | Whether to show index | _boolean_ | `true` |
|
| showIndex | Whether to show index | _boolean_ | `true` |
|
||||||
| showIndicators | Whether to show indicators | _boolean_ | `false` |
|
| showIndicators | Whether to show indicators | _boolean_ | `false` |
|
||||||
| loop | Whether to enable loop | _boolean_ | `true` |
|
| 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_ | - |
|
| onClose | Emitted when ImagePreview is closed | _Function_ | - |
|
||||||
| onChange | Emitted when current image changed | _Function_ | - |
|
| onChange | Emitted when current image changed | _Function_ | - |
|
||||||
| onScale | Emitted when scaling current image | _Function_ | - |
|
| onScale | Emitted when scaling current image | _Function_ | - |
|
||||||
|
@ -186,7 +186,7 @@ export default {
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
|
| images | 需要预览的图片 URL 数组 | _string[]_ | `[]` |
|
||||||
| start-position | 图片预览起始位置索引 | _number \| string_ | `0` |
|
| start-position | 图片预览起始位置索引 | _number \| string_ | `0` |
|
||||||
| swipe-duration | 动画时长,单位为 ms | _number \| string_ | `500` |
|
| swipe-duration | 动画时长,单位为 ms | _number \| string_ | `300` |
|
||||||
| show-index | 是否显示页码 | _boolean_ | `true` |
|
| show-index | 是否显示页码 | _boolean_ | `true` |
|
||||||
| show-indicators | 是否显示轮播指示器 | _boolean_ | `false` |
|
| show-indicators | 是否显示轮播指示器 | _boolean_ | `false` |
|
||||||
| loop | 是否开启循环播放 | _boolean_ | `true` |
|
| loop | 是否开启循环播放 | _boolean_ | `true` |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user