From 4ce07424edfa0049118ce343eda2451869ccd4b0 Mon Sep 17 00:00:00 2001 From: D-Sketon <2055272094@qq.com> Date: Thu, 15 Feb 2024 14:23:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20menu=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/js/_app/components/sidebar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/js/_app/components/sidebar.ts b/source/js/_app/components/sidebar.ts index ac3fba4..e3d6a43 100644 --- a/source/js/_app/components/sidebar.ts +++ b/source/js/_app/components/sidebar.ts @@ -228,7 +228,7 @@ export const menuActive = () => { if (!target) return const isSamePath = target.pathname === location.pathname || target.pathname === location.pathname.replace('index.html', '') const isSubPath = !CONFIG.root.startsWith(target.pathname) && location.pathname.startsWith(target.pathname) - const active = target.hostname === location.hostname && (isSamePath || isSubPath) + const active = !target.onclick && target.hostname === location.hostname && (isSamePath || isSubPath) element.toggleClass('active', active) if (element.parentNode.child('.active') && parentItem.hasClass('dropdown')) { parentItem.removeClass('active').addClass('expand')