@@ -34,48 +34,48 @@ const overflowScrollReg = /scroll|auto/i;
34
34
const popupProps = {
35
35
position: {
36
36
type: String ,
37
- default: ' center' ,
37
+ default: ' center'
38
38
},
39
39
40
40
transition: String ,
41
41
42
42
closeable: {
43
43
type: Boolean ,
44
- default: false ,
44
+ default: false
45
45
},
46
46
closeIconPosition: {
47
47
type: String ,
48
- default: ' top-right' ,
48
+ default: ' top-right'
49
49
},
50
50
closeIcon: {
51
51
type: String ,
52
- default: ' cross' ,
52
+ default: ' cross'
53
53
},
54
54
55
55
closeOnClickOverlay: {
56
56
type: Boolean ,
57
- default: true ,
57
+ default: true
58
58
},
59
59
60
60
destroyOnClose: {
61
61
type: Boolean ,
62
- default: false ,
62
+ default: false
63
63
},
64
64
getContainer: String ,
65
65
round: {
66
66
type: Boolean ,
67
- default: false ,
68
- },
67
+ default: false
68
+ }
69
69
};
70
70
export default {
71
71
name: ' nut-popup' ,
72
72
mixins: [touchMixins],
73
73
components: {
74
- icon: Icon,
74
+ icon: Icon
75
75
},
76
76
props: {
77
77
... overlayProps,
78
- ... popupProps,
78
+ ... popupProps
79
79
},
80
80
created () {
81
81
this .transition ? (this .transitionName = this .transition ) : (this .transitionName = ` popup-slide-${ this .position } ` );
@@ -111,27 +111,27 @@ export default {
111
111
val === ' center' ? (this .transitionName = ' popup-fade' ) : (this .transitionName = ` popup-slide-${ this .position } ` );
112
112
},
113
113
getContainer: ' portal' ,
114
- overlay: ' renderOverlay' ,
114
+ overlay: ' renderOverlay'
115
115
},
116
116
data () {
117
117
return {
118
118
showSlot: true ,
119
119
transitionName: ' popup-fade-center' ,
120
- overlayInstant: null ,
120
+ overlayInstant: null
121
121
};
122
122
},
123
123
computed: {
124
124
transitionDuration () {
125
125
return this .duration ? this .duration + ' s' : ' initial' ;
126
- },
126
+ }
127
127
},
128
128
129
129
methods: {
130
130
open () {
131
131
if (this .opened ) {
132
132
return ;
133
133
}
134
- if (this .destroyOnClose ){
134
+ if (this .destroyOnClose ) {
135
135
this .showSlot = true ;
136
136
}
137
137
this .opened = true ;
@@ -144,7 +144,7 @@ export default {
144
144
overlayClass,
145
145
overlayStyle,
146
146
lockScroll,
147
- closeOnClickOverlay,
147
+ closeOnClickOverlay
148
148
};
149
149
150
150
this .renderOverlay (config);
@@ -206,13 +206,12 @@ export default {
206
206
if (! overlayManager .lockCount ) {
207
207
document .body .classList .remove (' nut-overflow-hidden' );
208
208
}
209
- }
210
- if (this .destroyOnClose ){
211
- setTimeout (()=> {
209
+ }
210
+ if (this .destroyOnClose ) {
211
+ setTimeout (() => {
212
212
this .showSlot = false ;
213
- },this .duration * 1000 )
213
+ }, this .duration * 1000 );
214
214
}
215
-
216
215
217
216
overlayManager .closeOverlay (this );
218
217
this .$emit (' input' , false );
@@ -235,8 +234,8 @@ export default {
235
234
if (container && container !== el .parentNode ) {
236
235
container .appendChild (el);
237
236
}
238
- },
239
- },
237
+ }
238
+ }
240
239
};
241
240
export { popupProps };
242
241
</script >
0 commit comments