Skip to content

Commit 8c78778

Browse files
committed
05_06
1 parent af4f4c6 commit 8c78778

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

vuejs3-linkedin-project/src/router/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { createRouter, createWebHistory } from "vue-router";
22
import Home from "../views/Home.vue";
33
import Contact from "../views/Contact.vue";
4+
import NotFound from "../views/NotFound.vue";
5+
46

57
const routes = [
68
{
@@ -13,12 +15,11 @@ const routes = [
1315
name: "Contact",
1416
component: Contact,
1517
alias: "/contact"
16-
}
17-
/*,
18+
},
1819
{
19-
path: "/contact",
20-
redirect: {name: "Contact"}
21-
}*/
20+
path: '/:catchAll(.*)',
21+
component: NotFound
22+
}
2223
];
2324

2425
const router = createRouter({
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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>

0 commit comments

Comments
 (0)