[improvement] ImagePreview: add onClose params (#2197)

This commit is contained in:
neverland
2018-12-01 09:03:35 +08:00
committed by GitHub
parent d14f9cb5dc
commit 1b1e5caa19
7 changed files with 41 additions and 11 deletions

View File

@@ -141,8 +141,14 @@ export default create({
// prevent long tap to close component
if (deltaTime < 300 && offsetX < 10 && offsetY < 10) {
this.$emit('input', false);
const index = this.active;
this.resetScale();
this.$emit('input', false);
this.$emit('close', {
index,
url: this.images[index]
});
}
},