mirror of https://github.com/ElemeFE/element
MessageBox: reject all cancel actions
parent
fa861c5d90
commit
0137e5b80a
|
@ -179,7 +179,7 @@ You can use the `close` event to add and remove tag dynamically.
|
|||
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
||||
| type | theme | string | primary/gray/success/warning/danger | — |
|
||||
| closable | whether Tab can be removed | boolean | — | false |
|
||||
| close-transition | whether the removal animation is disabled | boolean | — | false |
|
||||
| close-transition | whether to disable animations | boolean | — | false |
|
||||
| hit | whether Tag has a highlighted border | boolean | — | false |
|
||||
| color | background color of the tag | string | — | — |
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
||||
| type | 主题 | string | primary/gray/success/warning/danger | — |
|
||||
| closable | 是否可关闭 | boolean | — | false |
|
||||
| close-transition | 是否禁用关闭时的渐变动画 | boolean | — | false |
|
||||
| close-transition | 是否禁用渐变动画 | boolean | — | false |
|
||||
| hit | 是否有边框描边 | boolean | — | false |
|
||||
| color | 背景色 | string | — | — |
|
||||
|
||||
|
|
|
@ -47,19 +47,14 @@ const defaultCallback = action => {
|
|||
}
|
||||
}
|
||||
if (currentMsg.resolve) {
|
||||
let $type = currentMsg.options.$type;
|
||||
if ($type === 'confirm' || $type === 'prompt') {
|
||||
if (action === 'confirm') {
|
||||
if (instance.showInput) {
|
||||
currentMsg.resolve({ value: instance.inputValue, action });
|
||||
} else {
|
||||
currentMsg.resolve(action);
|
||||
}
|
||||
} else if (action === 'cancel' && currentMsg.reject) {
|
||||
currentMsg.reject(action);
|
||||
if (action === 'confirm') {
|
||||
if (instance.showInput) {
|
||||
currentMsg.resolve({ value: instance.inputValue, action });
|
||||
} else {
|
||||
currentMsg.resolve(action);
|
||||
}
|
||||
} else {
|
||||
currentMsg.resolve(action);
|
||||
} else if (action === 'cancel' && currentMsg.reject) {
|
||||
currentMsg.reject(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue