MessageBox: reject all cancel actions

pull/5785/head
Leopoldthecoder 2017-07-02 19:56:25 +08:00 committed by 杨奕
parent fa861c5d90
commit 0137e5b80a
3 changed files with 9 additions and 14 deletions

View File

@ -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 | — | — |

View File

@ -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 | — | — |

View File

@ -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);
}
}
}