From 07ad4da4915a99ade60c533f435426fa29825338 Mon Sep 17 00:00:00 2001 From: msidolphin Date: Mon, 18 Mar 2019 09:22:46 +0800 Subject: [PATCH] fix dose't work properly for the first time --- src/components/affix/affix.vue | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/src/components/affix/affix.vue b/src/components/affix/affix.vue index af9874f..8510230 100644 --- a/src/components/affix/affix.vue +++ b/src/components/affix/affix.vue @@ -80,6 +80,9 @@ // window.addEventListener('resize', this.handleScroll, false); on(window, 'scroll', this.handleScroll); on(window, 'resize', this.handleScroll); + this.$nextTick(() => { + this.handleScroll(); + }) }, beforeDestroy () { // window.removeEventListener('scroll', this.handleScroll, false); -- libgit2 0.21.4