Commit 07ad4da4915a99ade60c533f435426fa29825338

Authored by msidolphin
Committed by GitHub
1 parent 5b143a2b

fix dose't work properly for the first time

Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
src/components/affix/affix.vue
... ... @@ -80,6 +80,9 @@
80 80 // window.addEventListener('resize', this.handleScroll, false);
81 81 on(window, 'scroll', this.handleScroll);
82 82 on(window, 'resize', this.handleScroll);
  83 + this.$nextTick(() => {
  84 + this.handleScroll();
  85 + })
83 86 },
84 87 beforeDestroy () {
85 88 // window.removeEventListener('scroll', this.handleScroll, false);
... ...