From 8ef6c7ee7dc7cd78ccbc2545a1ec29fad5243cee Mon Sep 17 00:00:00 2001
From: Pan <panfree23@gmail.com>
Date: Thu, 24 Jan 2019 13:48:19 +0800
Subject: [PATCH] perf[Sticky]: refine width default value

---
 src/components/Sticky/index.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/components/Sticky/index.vue b/src/components/Sticky/index.vue
index a287216d..5624a989 100644
--- a/src/components/Sticky/index.vue
+++ b/src/components/Sticky/index.vue
@@ -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()
-- 
GitLab