From f3a9f8b979d34dcbb08c9dfaadaec61d94e58872 Mon Sep 17 00:00:00 2001 From: alger Date: Sat, 11 Oct 2025 20:27:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E9=9A=90=E8=97=8Fmen?= =?UTF-8?q?u=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/layout/components/AppMenu.vue | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/renderer/layout/components/AppMenu.vue b/src/renderer/layout/components/AppMenu.vue index f968de9..7cc7af8 100644 --- a/src/renderer/layout/components/AppMenu.vue +++ b/src/renderer/layout/components/AppMenu.vue @@ -105,10 +105,11 @@ const toggleMenu = () => { max-height: calc(100vh - 120px); /* 为header预留空间,防止菜单项被遮挡 */ overflow-y: auto; overflow-x: hidden; - /* 自定义滚动条样式 */ + /* 自定义滚动条样式 - 默认隐藏,悬停时显示 */ scrollbar-width: thin; - scrollbar-color: rgba(156, 163, 175, 0.5) transparent; + scrollbar-color: transparent transparent; padding-bottom: 20px; + transition: scrollbar-color 0.3s ease; &::-webkit-scrollbar { width: 4px; @@ -119,11 +120,21 @@ const toggleMenu = () => { } &::-webkit-scrollbar-thumb { - background-color: rgba(156, 163, 175, 0.5); + background-color: transparent; border-radius: 2px; + transition: background-color 0.3s ease; + } - &:hover { - background-color: rgba(156, 163, 175, 0.7); + /* 悬停时显示滚动条 */ + &:hover { + scrollbar-color: rgba(156, 163, 175, 0.5) transparent; + + &::-webkit-scrollbar-thumb { + background-color: rgba(156, 163, 175, 0.5); + + &:hover { + background-color: rgba(156, 163, 175, 0.7); + } } } }