File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ export default {
2929 active: false ,
3030 position: ' ' ,
3131 width: undefined ,
32- height: undefined
32+ height: undefined ,
33+ isSticky: false
3334 }
3435 },
3536 mounted () {
@@ -52,6 +53,7 @@ export default {
5253 this .position = ' fixed'
5354 this .active = true
5455 this .width = this .width + ' px'
56+ this .isSticky = true
5557 },
5658 reset () {
5759 if (! this .active ) {
@@ -60,6 +62,7 @@ export default {
6062 this .position = ' '
6163 this .width = ' auto'
6264 this .active = false
65+ this .isSticky = false
6366 },
6467 handleScroll () {
6568 this .width = this .$el .getBoundingClientRect ().width
@@ -71,7 +74,9 @@ export default {
7174 this .reset ()
7275 },
7376 handleReize () {
74- this .width = this .$el .getBoundingClientRect ().width + ' px'
77+ if (this .isSticky ) {
78+ this .width = this .$el .getBoundingClientRect ().width + ' px'
79+ }
7580 }
7681 }
7782}
You can’t perform that action at this time.
0 commit comments