[bufix] Dialog: default options (#2208)

This commit is contained in:
neverland 2018-12-03 16:34:50 +08:00 committed by GitHub
parent ccf37b9a76
commit 5493dd3aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,7 @@ const Dialog = options => {
Object.assign(instance, {
resolve,
reject,
...Dialog.currentOptions,
...options
});
});
@ -53,13 +54,9 @@ Dialog.defaultOptions = {
}
};
Dialog.alert = options => Dialog({
...Dialog.currentOptions,
...options
});
Dialog.alert = Dialog;
Dialog.confirm = options => Dialog({
...Dialog.currentOptions,
showCancelButton: true,
...options
});