Skip to content

Commit 610f663

Browse files
authored
fix: scroll bar click problem (qier222#793)
Fixed the scroll bar click problem
1 parent c091e4c commit 610f663

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/Scrollbar.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,15 @@ export default {
116116
document.removeEventListener('mousemove', this.handleDragMove);
117117
document.removeEventListener('mouseup', this.handleDragEnd);
118118
},
119-
handleClick() {
119+
handleClick(e) {
120+
let scrollTop;
121+
if (e.clientY < this.top + 84) {
122+
scrollTop = -256;
123+
} else {
124+
scrollTop = 256;
125+
}
120126
this.main.scrollBy({
121-
top: 256,
127+
top: scrollTop,
122128
behavior: 'smooth',
123129
});
124130
},

0 commit comments

Comments
 (0)