1 | import Modal, { destroyFns } from './Modal';
|
2 | import confirm, { withWarn, withInfo, withSuccess, withError, withConfirm } from './confirm';
|
3 |
|
4 | function modalWarn(props) {
|
5 | return confirm(withWarn(props));
|
6 | }
|
7 |
|
8 | Modal.info = function infoFn(props) {
|
9 | return confirm(withInfo(props));
|
10 | };
|
11 |
|
12 | Modal.success = function successFn(props) {
|
13 | return confirm(withSuccess(props));
|
14 | };
|
15 |
|
16 | Modal.error = function errorFn(props) {
|
17 | return confirm(withError(props));
|
18 | };
|
19 |
|
20 | Modal.warning = modalWarn;
|
21 | Modal.warn = modalWarn;
|
22 |
|
23 | Modal.confirm = function confirmFn(props) {
|
24 | return confirm(withConfirm(props));
|
25 | };
|
26 |
|
27 | Modal.destroyAll = function destroyAllFn() {
|
28 | while (destroyFns.length) {
|
29 | var close = destroyFns.pop();
|
30 |
|
31 | if (close) {
|
32 | close();
|
33 | }
|
34 | }
|
35 | };
|
36 |
|
37 |
|
38 |
|
39 | Modal.install = function (app) {
|
40 | app.component(Modal.name, Modal);
|
41 | return app;
|
42 | };
|
43 |
|
44 | export default Modal; |
\ | No newline at end of file |