mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[bugfix] Dialog: default options (#999)
This commit is contained in:
parent
10c54fc649
commit
c25654d153
@ -38,6 +38,11 @@ function getContext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Dialog: Dialog = options => {
|
const Dialog: Dialog = options => {
|
||||||
|
options = {
|
||||||
|
...Dialog.currentOptions,
|
||||||
|
...options
|
||||||
|
};
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const context = options.context || getContext();
|
const context = options.context || getContext();
|
||||||
const dialog = context.selectComponent(options.selector);
|
const dialog = context.selectComponent(options.selector);
|
||||||
@ -73,15 +78,10 @@ Dialog.defaultOptions = {
|
|||||||
transition: true
|
transition: true
|
||||||
};
|
};
|
||||||
|
|
||||||
Dialog.alert = options =>
|
Dialog.alert = Dialog;
|
||||||
Dialog({
|
|
||||||
...Dialog.currentOptions,
|
|
||||||
...options
|
|
||||||
});
|
|
||||||
|
|
||||||
Dialog.confirm = options =>
|
Dialog.confirm = options =>
|
||||||
Dialog({
|
Dialog({
|
||||||
...Dialog.currentOptions,
|
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
...options
|
...options
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user