Skip to content

Commit

Permalink
perf[Sticky]: refine width default value
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed Jan 24, 2019
1 parent eb1d338 commit 8ef6c7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Sticky/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 8ef6c7e

Please sign in to comment.