[bugfix] Dialog: promise status not change (#585)

This commit is contained in:
neverland 2018-09-17 19:43:56 +08:00 committed by GitHub
parent 408579a046
commit 78b0d78b44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

11
dist/dialog/index.js vendored
View File

@ -77,12 +77,21 @@ create({
this.onClose(action); this.onClose(action);
}, },
close() {
this.setData({ show: false });
},
onClose(action) { onClose(action) {
if (!this.data.asyncClose) { if (!this.data.asyncClose) {
this.setData({ show: false }); this.close();
} }
this.$emit('close', action); this.$emit('close', action);
this.$emit(action); this.$emit(action);
const callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel'];
if (callback) {
callback(this);
}
} }
} }
}); });

View File

@ -77,12 +77,21 @@ create({
this.onClose(action); this.onClose(action);
}, },
close() {
this.setData({ show: false });
},
onClose(action) { onClose(action) {
if (!this.data.asyncClose) { if (!this.data.asyncClose) {
this.setData({ show: false }); this.close();
} }
this.$emit('close', action); this.$emit('close', action);
this.$emit(action); this.$emit(action);
const callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel'];
if (callback) {
callback(this);
}
} }
} }
}); });