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(() => {