From d253295d4c7d345c70dc3ee242be899c338a81c7 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 17 Apr 2019 12:32:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5):=20=E9=A1=B5=E9=9D=A2=E5=90=8E=E9=80=80?= =?UTF-8?q?=E6=97=B6=EF=BC=8Cscroll-view=20=E6=BB=9A=E5=8A=A8=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/scroll-view/index.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/view/components/scroll-view/index.vue b/src/core/view/components/scroll-view/index.vue index 632321f5..b60017cd 100644 --- a/src/core/view/components/scroll-view/index.vue +++ b/src/core/view/components/scroll-view/index.vue @@ -166,6 +166,11 @@ export default { passive: false } : false) }, + activated () { + // 还原 scroll-view 滚动位置 + this.scrollY && (this.$refs.main.scrollTop = this.lastScrollTop) + this.scrollX && (this.$refs.main.scrollLeft = this.lastScrollLeft) + }, beforeDestroy () { this.$refs.main.removeEventListener('touchstart', this.__handleTouchStart, passiveOptions) this.$refs.main.removeEventListener('touchmove', this.__handleTouchMove, passiveOptions) -- GitLab