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 {
2828 return {
2929 active: false ,
3030 position: ' ' ,
31- currentTop: ' ' ,
3231 width: undefined ,
33- height: undefined ,
34- child: null ,
35- stickyHeight: 0
32+ height: undefined
3633 }
3734 },
3835 mounted () {
3936 this .height = this .$el .getBoundingClientRect ().height
4037 window .addEventListener (' scroll' , this .handleScroll )
38+ window .addEventListener (' resize' , this .handleReize )
4139 },
4240 activated () {
4341 this .handleScroll ()
4442 },
4543 destroyed () {
4644 window .removeEventListener (' scroll' , this .handleScroll )
45+ window .removeEventListener (' resize' , this .handleReize )
4746 },
4847 methods: {
4948 sticky () {
@@ -70,6 +69,9 @@ export default {
7069 return
7170 }
7271 this .reset ()
72+ },
73+ handleReize () {
74+ this .width = this .$el .getBoundingClientRect ().width + ' px'
7375 }
7476 }
7577}
You can’t perform that action at this time.
0 commit comments