From 610f663c240a0be37e8bec9aea76fd93e55cd9d3 Mon Sep 17 00:00:00 2001 From: zuotiya <59996739+zuotiya@users.noreply.github.com> Date: Thu, 17 Jun 2021 12:30:51 +0800 Subject: [PATCH] fix: scroll bar click problem (#793) Fixed the scroll bar click problem --- src/components/Scrollbar.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Scrollbar.vue b/src/components/Scrollbar.vue index aefcddd..d2e793d 100644 --- a/src/components/Scrollbar.vue +++ b/src/components/Scrollbar.vue @@ -116,9 +116,15 @@ export default { document.removeEventListener('mousemove', this.handleDragMove); document.removeEventListener('mouseup', this.handleDragEnd); }, - handleClick() { + handleClick(e) { + let scrollTop; + if (e.clientY < this.top + 84) { + scrollTop = -256; + } else { + scrollTop = 256; + } this.main.scrollBy({ - top: 256, + top: scrollTop, behavior: 'smooth', }); },