From 07ad4da4915a99ade60c533f435426fa29825338 Mon Sep 17 00:00:00 2001 From: msidolphin Date: Mon, 18 Mar 2019 09:22:46 +0800 Subject: [PATCH 1/2] fix dose't work properly for the first time --- src/components/affix/affix.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/affix/affix.vue b/src/components/affix/affix.vue index af9874f9..85102309 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); From a1eb3bfacb979cb197f35920a57925d04878acc7 Mon Sep 17 00:00:00 2001 From: msidolphin Date: Mon, 18 Mar 2019 09:30:40 +0800 Subject: [PATCH 2/2] fix #5440 --- src/components/affix/affix.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/affix/affix.vue b/src/components/affix/affix.vue index 85102309..c0716d8c 100644 --- a/src/components/affix/affix.vue +++ b/src/components/affix/affix.vue @@ -82,7 +82,7 @@ on(window, 'resize', this.handleScroll); this.$nextTick(() => { this.handleScroll(); - }) + }); }, beforeDestroy () { // window.removeEventListener('scroll', this.handleScroll, false);