From 3239ed9819d669d6c5739996a56e4801e2145bf1 Mon Sep 17 00:00:00 2001 From: renhang Date: Thu, 25 May 2017 18:32:59 +0800 Subject: [PATCH 1/2] backTop --- src/components/back-top/back-top.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/back-top/back-top.vue b/src/components/back-top/back-top.vue index 4ea7cfbb..482397d7 100644 --- a/src/components/back-top/back-top.vue +++ b/src/components/back-top/back-top.vue @@ -67,7 +67,8 @@ this.backTop = window.pageYOffset >= this.height; }, back () { - scrollTop(window, document.body.scrollTop, 0, this.duration); + let scrollTop = document.documentElement.scrollTop||document.body.scrollTop; + scrollTop(window, scrollTop, 0, this.duration); this.$emit('on-click'); } } From 4b19f87edf5bf65b42022e75bb4cf1731f355fed Mon Sep 17 00:00:00 2001 From: renhang Date: Thu, 25 May 2017 18:48:46 +0800 Subject: [PATCH 2/2] backTop --- src/components/back-top/back-top.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/back-top/back-top.vue b/src/components/back-top/back-top.vue index 482397d7..391ccf28 100644 --- a/src/components/back-top/back-top.vue +++ b/src/components/back-top/back-top.vue @@ -67,8 +67,8 @@ this.backTop = window.pageYOffset >= this.height; }, back () { - let scrollTop = document.documentElement.scrollTop||document.body.scrollTop; - scrollTop(window, scrollTop, 0, this.duration); + var sTop = document.documentElement.scrollTop||document.body.scrollTop; + scrollTop(window, sTop, 0, this.duration); this.$emit('on-click'); } }