From 0e9eaafeeaa3aa5684b1af11da40b344ba483f20 Mon Sep 17 00:00:00 2001
From: _island <82024018+QC2168@users.noreply.github.com>
Date: Fri, 17 Mar 2023 16:16:52 +0800
Subject: [PATCH] feat: "tags-view" support wheel scroll (#62)
---
src/layout/components/TagsView/ScrollPane.vue | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue
index e5f2c25..c5f25cd 100644
--- a/src/layout/components/TagsView/ScrollPane.vue
+++ b/src/layout/components/TagsView/ScrollPane.vue
@@ -20,6 +20,14 @@ const scroll = ({ scrollLeft }: { scrollLeft: number }) => {
currentScrollLeft = scrollLeft
}
+const wheelScroll = ({ deltaY }: WheelEvent) => {
+ if (/^-/.test(deltaY.toString())) {
+ scrollTo("left")
+ } else {
+ scrollTo("right")
+ }
+}
+
/** 点击滚动 */
const scrollTo = (direction: "left" | "right") => {
let scrollLeft = 0
@@ -48,7 +56,7 @@ const showScreenfull = computed(() => {
-
+