We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbb1aaa commit 875fdb5Copy full SHA for 875fdb5
2 files changed
src/router/index.ts
@@ -14,7 +14,10 @@ const router = createRouter({
14
},
15
...appRoutes,
16
NO_PERMISSION,
17
- // DETAIL,
+ {
18
+ path: '/:pathMatch(.*)',
19
+ component: import('@/views/notFound/index.vue'),
20
+ },
21
],
22
scrollBehavior(_to, _from, savedPosition) {
23
if (savedPosition) {
src/views/notFound/index.vue
@@ -0,0 +1,21 @@
1
+<template>
2
+ <a-result
3
+ status="404"
4
+ :subtitle="$t('Page not found.')"
5
+ class="h-screen flex flex-col justify-center"
6
+ >
7
+ <template #extra>
8
+ <a-space>
9
+ <a-button type="primary" @click="router.replace('/')">
10
+ 返回主页
11
+ </a-button>
12
+ </a-space>
13
+ </template>
+ </a-result>
+</template>
+
+<script setup lang="ts">
+import router from '@/router';
+</script>
+<style scoped lang="less"></style>
0 commit comments