Skip to content

Commit e0b0be3

Browse files
committed
fix(sidebar): removes not found route from sidebar
1 parent 6a1153e commit e0b0be3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/SideBar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const router = useRouter()
66
const routeNames = router
77
.getRoutes()
88
.map((route: RouteRecordNormalized) => route.name)
9-
.filter((name) => name != 'main')
9+
.filter((name) => name != 'main' && name != 'Not found')
1010
</script>
1111

1212
<template>

src/router/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ const router = createRouter({
4545
name: "Newton's cradle",
4646
component: NewtonsCradleView
4747
},
48-
{ path: '/:pathMatch(.*)', component: MainView } // Fallback route
48+
{
49+
path: '/:pathMatch(.*)',
50+
name: 'Not found',
51+
component: MainView
52+
}
4953
]
5054
})
5155

0 commit comments

Comments
 (0)