File tree 2 files changed +70
-0
lines changed
2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { createRouter, createWebHistory } from 'vue-router'
4
4
import App from './App.vue'
5
5
import Home from './views/Home.vue'
6
6
import Create from './views/Create.vue'
7
+ import PageNotFound from './views/PageNotFound.vue'
7
8
8
9
const routes = [
9
10
{
@@ -15,6 +16,12 @@ const routes = [
15
16
name : 'create' ,
16
17
path : '/create' ,
17
18
component : Create
19
+ } ,
20
+
21
+ {
22
+ name : 'NotFound' ,
23
+ path : '/:catchAll(.*)' ,
24
+ component : PageNotFound
18
25
}
19
26
]
20
27
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <main >
3
+ <NavBar />
4
+ <div class =" heading" >
5
+ <h1 >404 Page Not Found</h1 >
6
+ <p >Oops! We couldn't find that page.</p >
7
+ <p >
8
+ Go back to the
9
+ <RouterLink to =" /" class =" link alt" :style =" learnMore"
10
+ >homepage</RouterLink
11
+ >.
12
+ </p >
13
+ </div >
14
+ <Footer />
15
+ </main >
16
+ </template >
17
+
18
+ <script >
19
+ import NavBar from ' ../components/NavBar.vue'
20
+ import Footer from ' ../components/Footer.vue'
21
+ import { onUnmounted } from ' vue'
22
+ import { store } from ' ../store'
23
+
24
+ export default {
25
+ components: {
26
+ NavBar,
27
+ Footer
28
+ },
29
+ setup () {
30
+ onUnmounted (() => {
31
+ // delete each property of config
32
+ // since `store.config` is being watched in store.js
33
+ // and Vue watch function does not tracked
34
+ // if we reassign `store.config` (i.e. store.config = {})
35
+ for (const config in store .config ) {
36
+ delete store .config [config]
37
+ }
38
+ // since we delete each property,
39
+ // it is better to reassign the initial values
40
+ // which are defined in store.js
41
+ store .config .template = ' '
42
+ store .config .include_test = false
43
+ store .config .output_dir = ' ./logs'
44
+ store .config .log_every_iters = 2
45
+ })
46
+ }
47
+ }
48
+ </script >
49
+
50
+ <style scoped>
51
+ h1 {
52
+ color : var (--c-brand-red );
53
+ }
54
+ .heading {
55
+ max-width : 75vw ;
56
+ margin : auto ;
57
+ text-align : center ;
58
+ }
59
+ .heading .alt {
60
+ background : var (--c-white );
61
+ color : var (--c-brand-red );
62
+ }
63
+ </style >
You can’t perform that action at this time.
0 commit comments