Skip to content

Commit

Permalink
🐛 修复侧边导航滑块初始化异常 (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
A-kirami authored Dec 3, 2024
1 parent 5cd6e24 commit 73e53ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/AppSidebarNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function handleSlider(event: MouseEvent) {
}
}
const cssModule = useCssModule()
function checkRouteInNavItems(routePath: string) {
return navItems.some(navItem => routePath.startsWith(navItem.path))
}
Expand All @@ -71,7 +73,7 @@ watch(
if (isRouteInNavItems) {
await nextTick()
const el = document.querySelector<HTMLElement>('.navbar a.router-link-active')
const el = document.querySelector<HTMLElement>(`.${cssModule.navbar} a.router-link-active`)
if (el) {
activeSliderTop = el.offsetTop + 'px'
}
Expand Down

0 comments on commit 73e53ca

Please sign in to comment.