perf[Sticky]: refine width default value
This commit is contained in:
@@ -69,7 +69,8 @@ export default {
|
|||||||
this.isSticky = false
|
this.isSticky = false
|
||||||
},
|
},
|
||||||
handleScroll() {
|
handleScroll() {
|
||||||
this.width = this.$el.getBoundingClientRect().width
|
const width = this.$el.getBoundingClientRect().width
|
||||||
|
this.width = width || 'auto'
|
||||||
const offsetTop = this.$el.getBoundingClientRect().top
|
const offsetTop = this.$el.getBoundingClientRect().top
|
||||||
if (offsetTop < this.stickyTop) {
|
if (offsetTop < this.stickyTop) {
|
||||||
this.sticky()
|
this.sticky()
|
||||||
|
Reference in New Issue
Block a user