aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2022-04-05 17:40:35 +0200
committerGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2022-04-05 17:40:35 +0200
commit3db4f91c27a2ab37bb23d8feb77b6dffa9a92977 (patch)
tree9a389244652bb3bd788ca53670c41bf53d6d778b /src
parent655019cf23babcec2a2f1e03cac87744e3139304 (diff)
downloadit-tools-3db4f91c27a2ab37bb23d8feb77b6dffa9a92977.tar.gz
it-tools-3db4f91c27a2ab37bb23d8feb77b6dffa9a92977.tar.zst
it-tools-3db4f91c27a2ab37bb23d8feb77b6dffa9a92977.zip
feat(page): added 404 page
Diffstat (limited to 'src')
-rw-r--r--src/pages/404.page.vue32
-rw-r--r--src/plugins/naive.plugin.ts2
-rw-r--r--src/router.ts2
3 files changed, 36 insertions, 0 deletions
diff --git a/src/pages/404.page.vue b/src/pages/404.page.vue
new file mode 100644
index 0000000..87cbb0a
--- /dev/null
+++ b/src/pages/404.page.vue
@@ -0,0 +1,32 @@
+<script setup lang="ts">
+
+</script>
+
+<template>
+ <div class="e404-wrapper">
+ <n-result
+ status="404"
+ title="404 Not Found"
+ description="Sorry, this page does not seem to extist"
+ >
+ <template #footer>
+ <router-link to="/" #="{ navigate, href }" custom>
+ <n-button
+ tag="a"
+ :href="href"
+ secondary
+ @click="navigate"
+ type="success"
+ >Back home</n-button>
+ </router-link>
+ </template>
+ </n-result>
+ </div>
+</template>
+
+
+<style scoped>
+.e404-wrapper {
+ padding-top: 150px;
+}
+</style> \ No newline at end of file
diff --git a/src/plugins/naive.plugin.ts b/src/plugins/naive.plugin.ts
index 50bb9b5..86de7fb 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 00f39c8..68126b5 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 },
],
});