[new feature] ImagePreview: add asyncClose prop (#2198)

This commit is contained in:
neverland
2018-12-01 09:35:34 +08:00
committed by GitHub
parent 1b1e5caa19
commit 00fe13d800
6 changed files with 44 additions and 14 deletions

View File

@@ -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);
}
}
},