From 3db4f91c27a2ab37bb23d8feb77b6dffa9a92977 Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Tue, 5 Apr 2022 17:40:35 +0200 Subject: [PATCH] feat(page): added 404 page --- src/pages/404.page.vue | 32 ++++++++++++++++++++++++++++++++ src/plugins/naive.plugin.ts | 2 ++ src/router.ts | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 src/pages/404.page.vue diff --git a/src/pages/404.page.vue b/src/pages/404.page.vue new file mode 100644 index 00000000..87cbb0ac --- /dev/null +++ b/src/pages/404.page.vue @@ -0,0 +1,32 @@ + + + + + + \ No newline at end of file diff --git a/src/plugins/naive.plugin.ts b/src/plugins/naive.plugin.ts index 50bb9b52..86de7fb9 100644 --- a/src/plugins/naive.plugin.ts +++ b/src/plugins/naive.plugin.ts @@ -38,9 +38,11 @@ import { NMenu, NMessageProvider, NPageHeader, + NResult, } from 'naive-ui'; const components = [ + NResult, NPageHeader, NMessageProvider, NLayout, diff --git a/src/router.ts b/src/router.ts index 00f39c83..68126b57 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,6 +1,7 @@ import { layouts } from './layouts/index'; import { createRouter, createWebHistory } from 'vue-router'; import HomePage from './pages/Home.page.vue'; +import NotFound from './pages/404.page.vue'; import { tools } from './tools'; const router = createRouter({ @@ -12,6 +13,7 @@ const router = createRouter({ component: HomePage, }, ...tools.map(({ path, name, component, ...config }) => ({ path, name, component, meta: { isTool: true, layout: layouts.toolLayout, name, ...config } })), + { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound }, ], });