fix: scroll bar click problem (#793)

Fixed the scroll bar click problem
This commit is contained in:
zuotiya 2021-06-17 12:30:51 +08:00 committed by GitHub
parent c091e4cb9f
commit 610f663c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,9 +116,15 @@ export default {
document.removeEventListener('mousemove', this.handleDragMove); document.removeEventListener('mousemove', this.handleDragMove);
document.removeEventListener('mouseup', this.handleDragEnd); document.removeEventListener('mouseup', this.handleDragEnd);
}, },
handleClick() { handleClick(e) {
let scrollTop;
if (e.clientY < this.top + 84) {
scrollTop = -256;
} else {
scrollTop = 256;
}
this.main.scrollBy({ this.main.scrollBy({
top: 256, top: scrollTop,
behavior: 'smooth', behavior: 'smooth',
}); });
}, },