File tree 4 files changed +13
-9
lines changed
4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " zarm-vue" ,
3
- "version" : " 2.0.0-beta.1 " ,
3
+ "version" : " 2.0.0-beta.2 " ,
4
4
"description" : " zarm in vue" ,
5
5
"tags" : [
6
6
" zarm" ,
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ export default {
32
32
} ;
33
33
} ,
34
34
mounted ( ) {
35
- this . documentBodyStyle = document . body . style ;
35
+ const { top, position, width } = document . body . style ;
36
+ this . documentBodyStyle = { top, position, width } ;
36
37
} ,
37
38
beforeDestroy ( ) {
38
39
this . onAfterClose ( ) ;
@@ -50,8 +51,11 @@ export default {
50
51
} ,
51
52
onAfterClose ( ) {
52
53
if ( ! this . documentScrollble ) return ;
53
- document . body . style = this . documentBodyStyle ;
54
- // console.log(this.documentScrollTop);
54
+ const { top, position, width } = this . documentBodyStyle ;
55
+ // fixed ios10, android5.x readonly property bug
56
+ document . body . style . position = position ;
57
+ document . body . style . width = width ;
58
+ document . body . style . top = top ;
55
59
// scrollTop lost after set position:fixed, restore it back.
56
60
setScrollTop ( this . documentScrollTop ) ;
57
61
} ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ describe('Picker', () => {
46
46
} ,
47
47
} ) ;
48
48
wrapper . element . click ( ) ;
49
- expect ( wrapper . findComponent ( { name : 'zaPicker' } ) . vm . currentValue [ 0 ] ) . toBe ( '1' ) ;
49
+ expect ( wrapper . find ( { name : 'zaPicker' } ) . vm . currentValue [ 0 ] ) . toBe ( '1' ) ;
50
50
} ) ;
51
51
52
52
it ( 'single column' , ( ) => {
@@ -70,7 +70,7 @@ describe('Picker', () => {
70
70
} ,
71
71
} ) ;
72
72
wrapper . element . click ( ) ;
73
- expect ( wrapper . findComponent ( { name : 'zaPicker' } ) . vm . currentValue [ 0 ] ) . toBe ( '1' ) ;
73
+ expect ( wrapper . find ( { name : 'zaPicker' } ) . vm . currentValue [ 0 ] ) . toBe ( '1' ) ;
74
74
} ) ;
75
75
76
76
it ( 'multi columns' , ( ) => {
Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ describe('Toast', () => {
42
42
const wrapper = mount ( TestCompo ) ;
43
43
const { vm } = wrapper ;
44
44
45
- expect ( vm . $el . classList . contains ( ' za-toast--open') ) . toBe ( true ) ;
45
+ expect ( wrapper . find ( '. za-toast--open') ) . toBeTruthy ( ) ;
46
46
setTimeout ( ( ) => {
47
- expect ( vm . $el . classList . contains ( ' za-toast--open') ) . toBe ( false ) ;
47
+ expect ( wrapper . find ( '. za-toast--open') ) . toBeTruthy ( ) ;
48
48
vm . visible = true ;
49
49
setTimeout ( ( ) => {
50
- expect ( vm . $el . classList . contains ( ' za-toast--open') ) . toBe ( true ) ;
50
+ expect ( wrapper . find ( '. za-toast--open') ) . toBeTruthy ( ) ;
51
51
done ( ) ;
52
52
} , 30 ) ;
53
53
} , 60 ) ;
You can’t perform that action at this time.
0 commit comments