Add a 404 page

This commit is contained in:
Daniel_I_Am 2021-09-01 23:28:13 +02:00
parent 73358d0619
commit 624ad8ad86
2 changed files with 22 additions and 0 deletions

View File

@ -6,12 +6,15 @@ import BlogArticle from './views/BlogArticle.vue';
import Snippets from './views/Snippets.vue'; import Snippets from './views/Snippets.vue';
import Contact from './views/Contact.vue'; import Contact from './views/Contact.vue';
import NotFound from './views/NotFound.vue';
const routes = [ const routes = [
{ path: '/', name: 'index', component: Home }, { path: '/', name: 'index', component: Home },
{ path: '/blog', name: 'blog', component: Blog }, { path: '/blog', name: 'blog', component: Blog },
{ path: '/blog/:year/:month/:day/:id-:slug', name: 'blog-article', component: BlogArticle, props: true }, { path: '/blog/:year/:month/:day/:id-:slug', name: 'blog-article', component: BlogArticle, props: true },
{ path: '/snippets', name: 'snippets', component: Snippets }, { path: '/snippets', name: 'snippets', component: Snippets },
{ path: '/contact', name: 'contact', component: Contact }, { path: '/contact', name: 'contact', component: Contact },
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
]; ];
const router = VueRouter.createRouter({ const router = VueRouter.createRouter({

View File

@ -0,0 +1,19 @@
<template>
<page-header></page-header>
<container>
{{ $route.params.pathMatch.pop() }}
</container>
</template>
<script>
import PageHeader from '../components/PageHeader.vue';
import Container from '../components/Container.vue';
export default {
components: {
PageHeader,
Container
}
}
</script>