From 9f85bf270ef36b466ab6e0b44d95cf36714991a8 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Mon, 27 Jul 2020 17:11:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=8E=92=E5=90=8D=E5=88=86?= =?UTF-8?q?=E6=9E=90=E5=92=8C=E8=AF=84=E4=BB=B7=E8=BD=AE=E6=92=AD=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/e-charts/commentlist.vue | 9 ++++++--- src/components/e-charts/toplist.vue | 13 +++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/e-charts/commentlist.vue b/src/components/e-charts/commentlist.vue index 68bfba4..6fd7f58 100644 --- a/src/components/e-charts/commentlist.vue +++ b/src/components/e-charts/commentlist.vue @@ -45,11 +45,14 @@ export default { this.$el.scrollTop = 0; this.timer = setInterval(() => { - let curScrollTop = this.$el.scrollTop + 50; - if (curScrollTop > this.$el.scrollHeight - this.$el.clientHeight) { + let itemHeight = 77; + let curScrollTop = this.$el.scrollTop + itemHeight; + + if (curScrollTop >= this.$el.scrollHeight - this.$el.clientHeight + itemHeight) { curScrollTop = 0; } - this.$el.scrollTop = curScrollTop; + + this.$el.scrollTop = Math.min(curScrollTop, this.$el.scrollHeight - this.$el.clientHeight); }, 1500); }, mouseenter() { diff --git a/src/components/e-charts/toplist.vue b/src/components/e-charts/toplist.vue index 122537c..099ad73 100644 --- a/src/components/e-charts/toplist.vue +++ b/src/components/e-charts/toplist.vue @@ -73,11 +73,14 @@ export default { this.$el.scrollTop = 0; this.timer = setInterval(() => { - let curScrollTop = this.$el.scrollTop + 50; - if (curScrollTop > this.$el.scrollHeight - this.$el.clientHeight) { + let itemHeight = 50; + let curScrollTop = this.$el.scrollTop + itemHeight; + + if (curScrollTop >= this.$el.scrollHeight - this.$el.clientHeight + itemHeight) { curScrollTop = 0; } - this.$el.scrollTop = curScrollTop; + + this.$el.scrollTop = Math.min(curScrollTop, this.$el.scrollHeight - this.$el.clientHeight); }, 1500); }, mouseenter() { @@ -161,7 +164,7 @@ export default { flex-grow: 1; } .item_info > span:first-child { - width: 200px; + width: 100px; flex-grow: 1; margin-right: 10px; } @@ -171,6 +174,8 @@ export default { color: #8e96ab; } .item_info > span:nth-child(2) { + flex-shrink: 0; + white-space: nowrap; color: #0d1847; } .item_progress { -- 2.26.0