Skip to content

Commit

Permalink
fix: menu异常
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Feb 15, 2024
1 parent e25d065 commit 4ce0742
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/js/_app/components/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 4ce0742

Please sign in to comment.