File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
vuejs3-linkedin-project/src Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { createRouter , createWebHistory } from "vue-router" ;
2
2
import Home from "../views/Home.vue" ;
3
3
import Contact from "../views/Contact.vue" ;
4
+ import NotFound from "../views/NotFound.vue" ;
5
+
4
6
5
7
const routes = [
6
8
{
@@ -13,12 +15,11 @@ const routes = [
13
15
name : "Contact" ,
14
16
component : Contact ,
15
17
alias : "/contact"
16
- }
17
- /*,
18
+ } ,
18
19
{
19
- path: "/contact" ,
20
- redirect: {name: "Contact"}
21
- }*/
20
+ path : '/:catchAll(.*)' ,
21
+ component : NotFound
22
+ }
22
23
] ;
23
24
24
25
const router = createRouter ( {
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <h1 >404</h1 >
4
+ <h2 >Nous n'avons pas pu trouver votre page</h2 >
5
+ </div >
6
+ </template >
7
+
8
+ <script >
9
+ export default {
10
+ name: " NotFound"
11
+ };
12
+ </script >
You can’t perform that action at this time.
0 commit comments