perf[Sticky]: refine width default value

This commit is contained in:
Pan 2019-01-24 13:48:19 +08:00
parent 93c13d2cea
commit 2d275a9891
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ export default {
this.isSticky = false
},
handleScroll() {
this.width = this.$el.getBoundingClientRect().width
const width = this.$el.getBoundingClientRect().width
this.width = width || 'auto'
const offsetTop = this.$el.getBoundingClientRect().top
if (offsetTop < this.stickyTop) {
this.sticky()