From 8cf24e8b91d51f836fb22c0d8672f88ef272970d Mon Sep 17 00:00:00 2001 From: yma16 <17685043634@163.com> Date: Wed, 14 Sep 2022 23:21:34 +0800 Subject: [PATCH] =?UTF-8?q?perf:=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=80=BB=E8=BE=91=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Article.vue | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/Article.vue b/src/components/Article.vue index 9c67858..e67dab3 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -179,7 +179,7 @@ border: rgba(0, 0, 0, 0); " > -
+
0 + that.topShow = Math.ceil(e.target.scrollTop) !== 0 }) } else if (dom && key === 'remove') { dom.removeEventListener('scroll', function (e) { - this.topShow = e.scrollTop > 0 + that.topShow = e.target.scrollTop === 0 }) } }, @@ -376,9 +378,9 @@ export default { this.$store.commit('increment') }, topVisible: function () { - let dom = document.getElementById('homeTitleId') - this.topShow = this.elementIsVisibleInViewport(dom) - setTimeout(this.topVisible) + // let dom = document.getElementById('homeTitleId') + // this.topShow = this.elementIsVisibleInViewport(dom) + // setTimeout(this.topVisible) }, elementIsVisibleInViewport: function (el, partiallyVisible = false) { try { -- GitLab