From bc2106289b322d11ef924c54666e45c3e3943671 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Mon, 15 Apr 2024 15:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/CategoryHeader.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/layout/components/CategoryHeader.vue b/src/layout/components/CategoryHeader.vue index 62a3f8eb6..fa2a92d56 100644 --- a/src/layout/components/CategoryHeader.vue +++ b/src/layout/components/CategoryHeader.vue @@ -48,8 +48,13 @@ export default defineComponent({ console.log('categoryRouters==',categoryRouters) //默认展开第一行 const currentPath = useRouter().currentRoute.value.matched[0].path + console.log('默认数据',currentPath) if(currentPath){ - appStore.setCategoryRoutePath(currentPath) + if(currentPath=='/'){ + appStore.setCategoryRoutePath(categoryRouters[0].path) + }else{ + appStore.setCategoryRoutePath(currentPath) + } } const activeMenu = computed(() => {