mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(ImagePreview): should reset scale when hide (#6661)
This commit is contained in:
parent
8e9aad2c9f
commit
2816c0ff8a
@ -147,6 +147,7 @@ export default createComponent({
|
|||||||
{this.images.map((image) => (
|
{this.images.map((image) => (
|
||||||
<ImagePreviewItem
|
<ImagePreviewItem
|
||||||
src={image}
|
src={image}
|
||||||
|
show={this.value}
|
||||||
active={this.active}
|
active={this.active}
|
||||||
maxZoom={this.maxZoom}
|
maxZoom={this.maxZoom}
|
||||||
minZoom={this.minZoom}
|
minZoom={this.minZoom}
|
||||||
|
@ -23,6 +23,7 @@ export default {
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
src: String,
|
src: String,
|
||||||
|
show: Boolean,
|
||||||
active: Number,
|
active: Number,
|
||||||
minZoom: [Number, String],
|
minZoom: [Number, String],
|
||||||
maxZoom: [Number, String],
|
maxZoom: [Number, String],
|
||||||
@ -81,6 +82,14 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
show(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.resetScale();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.bindTouchEvent(this.$el);
|
this.bindTouchEvent(this.$el);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user