File tree 8 files changed +31
-21
lines changed
8 files changed +31
-21
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " zarm-vue" ,
3
- "version" : " 1.4.2 " ,
3
+ "version" : " 1.5.0 " ,
4
4
"description" : " zarm in vue" ,
5
5
"tags" : [
6
6
" zarm" ,
Original file line number Diff line number Diff line change 1
1
<template lang="html">
2
- <div :class =' {
2
+ <div
3
+ :class =' {
3
4
[`${prefixCls}`]: true,
4
- [`${prefixCls}-hidden`]: !currentVisible ,
5
+ [`${prefixCls}-hidden`]: !maskVisible ,
5
6
}'
6
7
>
7
8
<div :class =' {
10
11
}'
11
12
:style =' transitionDurationStyle'
12
13
>
13
- <slot ></slot>
14
+ <template v-if =" currentVisible " >
15
+ <slot ></slot >
16
+ </template >
14
17
</div>
15
18
<za-mask
16
19
:class =' [`fade-${animationState}`]'
@@ -104,10 +107,10 @@ export default {
104
107
if (value) {
105
108
this .enter ();
106
109
} else {
107
- this .currentVisible = value;
108
110
this .animationState = ' leave' ;
111
+ this .maskVisible = false ;
109
112
this .timerLeave = setTimeout (() => {
110
- this .maskVisible = false ;
113
+ this .currentVisible = value ;
111
114
}, this .animationDuration );
112
115
}
113
116
},
Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ export default {
133
133
visible (val , oldVal ) { // eslint-disable-line no-unused-vars
134
134
if (this .currentVisible === val) return ;
135
135
this .currentVisible = val;
136
+ if (val) {
137
+ this .reposition ();
138
+ }
136
139
},
137
140
value (val , oldVal ) { // eslint-disable-line no-unused-vars
138
141
const param = {
@@ -302,11 +305,11 @@ export default {
302
305
}
303
306
},
304
307
},
305
- mounted () {
306
- this .reposition ();
307
- },
308
- updated () {
309
- this .reposition ();
310
- },
308
+ // mounted() {
309
+ // this.reposition();
310
+ // },
311
+ // updated() {
312
+ // this.reposition();
313
+ // },
311
314
};
312
315
</script >
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ describe('CascadePicker', () => {
61
61
data ( ) {
62
62
return {
63
63
value : '' ,
64
- visible : false ,
64
+ visible : true ,
65
65
data,
66
66
} ;
67
67
} ,
Original file line number Diff line number Diff line change @@ -202,15 +202,14 @@ describe('DatePicker', () => {
202
202
vm = createVue ( {
203
203
template : `
204
204
<za-date-select
205
- :visible.sync='visible'
206
205
v-model='value'
207
206
mode='date'
208
207
@ok='handleOk'/>
209
208
` ,
210
209
data ( ) {
211
210
return {
212
211
value : '2000-01-01' ,
213
- visible : false ,
212
+ visible : true ,
214
213
} ;
215
214
} ,
216
215
methods : {
@@ -219,8 +218,9 @@ describe('DatePicker', () => {
219
218
} ,
220
219
} ,
221
220
} , true ) ;
222
- vm . $el . querySelector ( '.za-picker-submit' ) . click ( ) ;
221
+ vm . $el . click ( ) ;
223
222
vm . $nextTick ( ( ) => {
223
+ vm . $el . querySelector ( '.za-picker-submit' ) . click ( ) ;
224
224
expect ( value . getFullYear ( ) ) . to . equal ( 2000 ) ;
225
225
done ( ) ;
226
226
} ) ;
@@ -231,15 +231,14 @@ describe('DatePicker', () => {
231
231
vm = createVue ( {
232
232
template : `
233
233
<za-date-select
234
- :visible.sync='visible'
235
234
v-model='value'
236
235
mode='date'
237
236
@ok='handleOk'/>
238
237
` ,
239
238
data ( ) {
240
239
return {
241
240
value : '2000-01-01' ,
242
- visible : false ,
241
+ visible : true ,
243
242
} ;
244
243
} ,
245
244
methods : {
@@ -248,6 +247,7 @@ describe('DatePicker', () => {
248
247
} ,
249
248
} ,
250
249
} , true ) ;
250
+ vm . $el . click ( ) ;
251
251
vm . $nextTick ( ( ) => {
252
252
vm . value = '2018-07-06' ;
253
253
vm . $nextTick ( ( ) => {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ describe('InputNumber', () => {
40
40
<za-input-number type="number"></za-input-number>
41
41
` ,
42
42
} , true ) ;
43
+ vm . $el . click ( ) ;
43
44
vm . $nextTick ( ( ) => {
44
45
const disabledItem = vm . $el . querySelectorAll ( '.za-keyboard-item' ) [ 9 ] ;
45
46
expect ( disabledItem . classList . contains ( 'za-keyboard-item-disabled' ) ) . to . be . true ;
@@ -73,6 +74,7 @@ describe('InputNumber', () => {
73
74
} ;
74
75
} ,
75
76
} , true ) ;
77
+ vm . $el . click ( ) ;
76
78
vm . v1 = '12311' ;
77
79
vm . $nextTick ( ( ) => {
78
80
const contentEl = vm . $el . querySelector ( '.za-input-content' ) ;
@@ -92,6 +94,7 @@ describe('InputNumber', () => {
92
94
} ;
93
95
} ,
94
96
} , true ) ;
97
+ vm . $el . click ( ) ;
95
98
vm . $nextTick ( ( ) => {
96
99
vm . $el . querySelector ( '.za-keyboard-item' ) . click ( ) ;
97
100
expect ( vm . v1 ) . to . equal ( '1231' ) ;
Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ describe('Picker', () => {
187
187
template : `
188
188
<za-picker
189
189
v-model='value'
190
+ :visible.sync='visible'
190
191
:dataSource='data1'/>
191
192
` ,
192
193
data ( ) {
@@ -253,7 +254,7 @@ describe('Picker', () => {
253
254
data ( ) {
254
255
return {
255
256
value : '' ,
256
- visible : false ,
257
+ visible : true ,
257
258
data1 : [
258
259
{ value : '1' , label : '选项一' } ,
259
260
{ value : '2' , label : '选项二' } ,
@@ -287,7 +288,7 @@ describe('Picker', () => {
287
288
data ( ) {
288
289
return {
289
290
value : '1' ,
290
- visible : false ,
291
+ visible : true ,
291
292
data1 : [
292
293
{ value : '1' , label : '选项一' } ,
293
294
{ value : '2' , label : '选项二' } ,
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ describe('StackPicker', () => {
64
64
data ( ) {
65
65
return {
66
66
value : [ ] ,
67
- visible : false ,
67
+ visible : true ,
68
68
data,
69
69
} ;
70
70
} ,
You can’t perform that action at this time.
0 commit comments