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 | — |
|
| type | theme | string | primary/gray/success/warning/danger | — |
|
||||||
| closable | whether Tab can be removed | boolean | — | false |
|
| 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 |
|
| hit | whether Tag has a highlighted border | boolean | — | false |
|
||||||
| color | background color of the tag | string | — | — |
|
| color | background color of the tag | string | — | — |
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@
|
||||||
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
||||||
| type | 主题 | string | primary/gray/success/warning/danger | — |
|
| type | 主题 | string | primary/gray/success/warning/danger | — |
|
||||||
| closable | 是否可关闭 | boolean | — | false |
|
| closable | 是否可关闭 | boolean | — | false |
|
||||||
| close-transition | 是否禁用关闭时的渐变动画 | boolean | — | false |
|
| close-transition | 是否禁用渐变动画 | boolean | — | false |
|
||||||
| hit | 是否有边框描边 | boolean | — | false |
|
| hit | 是否有边框描边 | boolean | — | false |
|
||||||
| color | 背景色 | string | — | — |
|
| color | 背景色 | string | — | — |
|
||||||
|
|
||||||
|
|
|
@ -47,19 +47,14 @@ const defaultCallback = action => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentMsg.resolve) {
|
if (currentMsg.resolve) {
|
||||||
let $type = currentMsg.options.$type;
|
if (action === 'confirm') {
|
||||||
if ($type === 'confirm' || $type === 'prompt') {
|
if (instance.showInput) {
|
||||||
if (action === 'confirm') {
|
currentMsg.resolve({ value: instance.inputValue, action });
|
||||||
if (instance.showInput) {
|
} else {
|
||||||
currentMsg.resolve({ value: instance.inputValue, action });
|
currentMsg.resolve(action);
|
||||||
} else {
|
|
||||||
currentMsg.resolve(action);
|
|
||||||
}
|
|
||||||
} else if (action === 'cancel' && currentMsg.reject) {
|
|
||||||
currentMsg.reject(action);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else if (action === 'cancel' && currentMsg.reject) {
|
||||||
currentMsg.resolve(action);
|
currentMsg.reject(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue