diff --git a/src/components/e-charts/commentlist.vue b/src/components/e-charts/commentlist.vue index 68bfba420a4f14d62263b40ec31e13847a38afc9..6fd7f58eb401e8b6caf9e1e2863d8b5a9a37b4e5 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 122537c621378aaeb0494cf80a7922c4213057a6..099ad730e2267436a1431736a971a4d72dac6acb 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 {