diff --git a/src/pages/NotFound.vue b/src/pages/NotFound.vue new file mode 100644 index 0000000..5988a35 --- /dev/null +++ b/src/pages/NotFound.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/src/pages/Post.vue b/src/pages/Post.vue index 0fd2e7a..2a6c58d 100644 --- a/src/pages/Post.vue +++ b/src/pages/Post.vue @@ -1,16 +1,21 @@ diff --git a/src/router.js b/src/router.js index 8c8b2ba..77597a2 100644 --- a/src/router.js +++ b/src/router.js @@ -2,6 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'; import Index from './pages/Index.vue'; import Post from './pages/Post.vue'; import Posts from './pages/Posts.vue'; +import PageNotFound from './pages/NotFound.vue'; const router = createRouter({ history: createWebHistory(), @@ -10,6 +11,7 @@ const router = createRouter({ { path: '/practice', name: 'Practice', component: Index }, { path: '/posts/', name: 'Posts', component: Posts }, { path: '/posts/:slug', name: 'Post', component: Post }, + { path: '/:pathMatch(.*)*', name: 'NotFound', component: PageNotFound }, ], });