mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-26 00:09:15 +08:00
fix(ImagePreview): limit max-zoom when double clicking
This commit is contained in:
parent
43e9df1550
commit
1baa60f224
@ -258,8 +258,12 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setScale(scale) {
|
||||||
|
this.scale = range(scale, +this.minZoom, +this.maxZoom);
|
||||||
|
},
|
||||||
|
|
||||||
resetScale() {
|
resetScale() {
|
||||||
this.scale = 1;
|
this.setScale(1);
|
||||||
this.moveX = 0;
|
this.moveX = 0;
|
||||||
this.moveY = 0;
|
this.moveY = 0;
|
||||||
},
|
},
|
||||||
@ -267,7 +271,7 @@ export default createComponent({
|
|||||||
toggleScale() {
|
toggleScale() {
|
||||||
const scale = this.scale > 1 ? 1 : 2;
|
const scale = this.scale > 1 ? 1 : 2;
|
||||||
|
|
||||||
this.scale = scale;
|
this.setScale(scale);
|
||||||
this.moveX = 0;
|
this.moveX = 0;
|
||||||
this.moveY = 0;
|
this.moveY = 0;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user