导航栏激活

This commit is contained in:
李志鹏
2026-05-12 13:32:47 +08:00
parent baf57515c0
commit 3e0a7b8928

View File

@@ -8,7 +8,9 @@
v-for="v in navList1"
:key="v.path"
class="nav-item"
:class="{ active: activePath === v.path }"
:class="{
active: v.path === '/' ? activePath === v.path : new RegExp(`^${v.path}`).test(activePath)
}"
@click="onNavItemClick(v.path)"
>
<span>{{ v.name }}</span>
@@ -19,7 +21,7 @@
class="icon"
v-for="v in navList2"
:key="v.path"
:class="{ active: activePath === v.path }"
:class="{ active: new RegExp(`^${v.path}`).test(activePath) }"
@click="onNavItemClick(v.path)"
>
<svg-icon :name="activePath === v.path ? v.active_icon : v.icon" size="22" />