From 3e0a7b8928d39d51926de1fe2942c367a8e6a4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com> Date: Tue, 12 May 2026 13:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=BF=80=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main-header.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/main-header.vue b/src/views/main-header.vue index f9dddf3..4001bac 100644 --- a/src/views/main-header.vue +++ b/src/views/main-header.vue @@ -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)" > {{ v.name }} @@ -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)" >