File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,21 @@ export default {
28
28
return {
29
29
active: false ,
30
30
position: ' ' ,
31
- currentTop: ' ' ,
32
31
width: undefined ,
33
- height: undefined ,
34
- child: null ,
35
- stickyHeight: 0
32
+ height: undefined
36
33
}
37
34
},
38
35
mounted () {
39
36
this .height = this .$el .getBoundingClientRect ().height
40
37
window .addEventListener (' scroll' , this .handleScroll )
38
+ window .addEventListener (' resize' , this .handleReize )
41
39
},
42
40
activated () {
43
41
this .handleScroll ()
44
42
},
45
43
destroyed () {
46
44
window .removeEventListener (' scroll' , this .handleScroll )
45
+ window .removeEventListener (' resize' , this .handleReize )
47
46
},
48
47
methods: {
49
48
sticky () {
@@ -70,6 +69,9 @@ export default {
70
69
return
71
70
}
72
71
this .reset ()
72
+ },
73
+ handleReize () {
74
+ this .width = this .$el .getBoundingClientRect ().width + ' px'
73
75
}
74
76
}
75
77
}
You can’t perform that action at this time.
0 commit comments