1
0
mirror of https://gitee.com/vant-contrib/vant-weapp.git synced 2025-04-06 03:58:05 +08:00

[bugfix] Dialog: promise status not change ()

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
dist/dialog
packages/dialog

11
dist/dialog/index.js vendored

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

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