Skip to content

Commit

Permalink
Merge pull request #240 from D-Sketon/seo
Browse files Browse the repository at this point in the history
fix: menu异常
  • Loading branch information
D-Sketon committed Feb 15, 2024
2 parents 2e2dc1f + 4ce0742 commit 531c25b
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 531c25b

Please sign in to comment.