mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[new feature] ImagePreview: add asyncClose prop (#2198)
This commit is contained in:
@@ -63,6 +63,7 @@ export default create({
|
||||
|
||||
props: {
|
||||
images: Array,
|
||||
asyncClose: Boolean,
|
||||
startPosition: Number,
|
||||
showIndicators: Boolean,
|
||||
loop: {
|
||||
@@ -144,11 +145,14 @@ export default create({
|
||||
const index = this.active;
|
||||
|
||||
this.resetScale();
|
||||
this.$emit('input', false);
|
||||
this.$emit('close', {
|
||||
index,
|
||||
url: this.images[index]
|
||||
});
|
||||
|
||||
if (!this.asyncClose) {
|
||||
this.$emit('input', false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user