File tree Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Expand file tree Collapse file tree 3 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export default {
64
64
{ cancelText }
65
65
</ ActionButton >
66
66
) ;
67
- const iconNode = typeof icon === 'string' ? < Icon type = { icon } /> : icon ;
67
+ const iconNode = typeof icon === 'string' ? < Icon type = { icon } /> : icon ( h ) ;
68
68
69
69
return (
70
70
< Dialog
Original file line number Diff line number Diff line change @@ -20,20 +20,20 @@ import Button from '../../button'
20
20
export default {
21
21
methods: {
22
22
showConfirm () {
23
+ const _self = this
23
24
for (let i = 0 ; i < 3 ; i += 1 ) {
24
25
setTimeout (() => {
25
26
this .$confirm ({
26
- content: (
27
- < Button onClick= {this .destroyAll }>
28
- Click to destroy all
29
- < / Button>
30
- ),
27
+ content: ' destroy all' ,
31
28
onOk () {
32
29
return new Promise ((resolve , reject ) => {
33
30
setTimeout (Math .random () > 0.5 ? resolve : reject, 1000 );
34
31
}).catch (() => console .log (' Oops errors!' ));
35
32
},
36
- onCancel () {},
33
+ cancelText: ' Click to destroy all' ,
34
+ onCancel () {
35
+ _self .destroyAll ()
36
+ },
37
37
});
38
38
}, i * 500 );
39
39
}
Original file line number Diff line number Diff line change 1
1
import Modal , { destroyFns } from './Modal' ;
2
2
import modalConfirm from './confirm' ;
3
+ import Icon from '../icon' ;
3
4
4
5
// export { ActionButtonProps } from './ActionButton'
5
6
// export { ModalProps, ModalFuncProps } from './Modal'
6
7
7
8
const info = function ( props ) {
8
9
const config = {
9
10
type : 'info' ,
10
- icon : < Icon type = "info-circle" /> ,
11
+ icon : ( h ) => {
12
+ return < Icon type = "info-circle" /> ;
13
+ } ,
11
14
okCancel : false ,
12
15
...props ,
13
16
} ;
@@ -17,7 +20,9 @@ const info = function(props) {
17
20
const success = function ( props ) {
18
21
const config = {
19
22
type : 'success' ,
20
- icon : < Icon type = "check-circle" /> ,
23
+ icon : ( h ) => {
24
+ return < Icon type = "check-circle" /> ;
25
+ } ,
21
26
okCancel : false ,
22
27
...props ,
23
28
} ;
@@ -27,7 +32,9 @@ const success = function(props) {
27
32
const error = function ( props ) {
28
33
const config = {
29
34
type : 'error' ,
30
- icon : < Icon type = "close-circle" /> ,
35
+ icon : ( h ) => {
36
+ return < Icon type = "close-circle" /> ;
37
+ } ,
31
38
okCancel : false ,
32
39
...props ,
33
40
} ;
@@ -37,7 +44,9 @@ const error = function(props) {
37
44
const warning = function ( props ) {
38
45
const config = {
39
46
type : 'warning' ,
40
- icon : < Icon type = "exclamation-circle" /> ,
47
+ icon : ( h ) => {
48
+ return < Icon type = "exclamation-circle" /> ;
49
+ } ,
41
50
okCancel : false ,
42
51
...props ,
43
52
} ;
You can’t perform that action at this time.
0 commit comments