fix(ImagePreview): should reset scale when hide (#6661)

This commit is contained in:
neverland 2020-07-01 12:55:30 +08:00 committed by GitHub
parent 8e9aad2c9f
commit 2816c0ff8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -147,6 +147,7 @@ export default createComponent({
{this.images.map((image) => (
<ImagePreviewItem
src={image}
show={this.value}
active={this.active}
maxZoom={this.maxZoom}
minZoom={this.minZoom}

View File

@ -23,6 +23,7 @@ export default {
props: {
src: String,
show: Boolean,
active: Number,
minZoom: [Number, String],
maxZoom: [Number, String],
@ -81,6 +82,14 @@ export default {
},
},
watch: {
show(val) {
if (!val) {
this.resetScale();
}
},
},
mounted() {
this.bindTouchEvent(this.$el);
},