Skip to content

Commit

Permalink
fix:修复面包屑问题
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Sep 9, 2023
1 parent bb484c1 commit 792c924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 2 additions & 3 deletions heming-web/components/BreadCrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const routes = ref<Array<any>>([
/** 路由变化 */
const handleRouterChange = async (uri: any) => {
console.log(router.currentRoute)
routes.value = []
routes.value.push({
href: '/',
Expand Down Expand Up @@ -51,9 +52,7 @@ const handleClick = async (path: string) => {
watch(() => {
return router.currentRoute.value.path
}, async (path) => {
if (path.startsWith('/admin')) {
await handleRouterChange(path)
}
await handleRouterChange(path)
})
onBeforeMount(async () => {
Expand Down
9 changes: 8 additions & 1 deletion heming-web/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ export default defineNuxtConfig({
},
prerender: {
crawlLinks: false,
routes: ['/'],
routes: [
'/',
'/login',
'/admin/user',
'/admin/menu',
'/admin/menu/menu11',
'/admin/menu/menu12',
],
},
preset: 'vercel'
},
Expand Down

0 comments on commit 792c924

Please sign in to comment.