Added 404 page

This commit is contained in:
Maximilian Giller 2021-01-03 20:50:52 +01:00
parent 63bfed7e76
commit d0da635fe5
3 changed files with 39 additions and 3 deletions

View file

@ -1,13 +1,18 @@
<template> <template>
<div> <main>
<BaseLogo id="logo" size="medium" center class="space-top" /> <BaseLogo id="logo" size="medium" center class="space-top" />
<BaseContainer :width="width" center class="space-bottom"> <BaseContainer
:width="width"
center
class="space-bottom"
:class="{ 'center-content': center }"
>
<BaseTitle v-if="title" center size="huge" class="centered"> <BaseTitle v-if="title" center size="huge" class="centered">
{{ title }} {{ title }}
</BaseTitle> </BaseTitle>
<slot /> <slot />
</BaseContainer> </BaseContainer>
</div> </main>
</template> </template>
<script> <script>
@ -30,6 +35,11 @@ export default {
title: { title: {
default: "", default: "",
type: String type: String
},
center: {
default: false,
required: false,
type: Boolean
} }
} }
}; };
@ -41,4 +51,7 @@ export default {
.space-bottom .space-bottom
margin-bottom: 5rem margin-bottom: 5rem
.center-content
text-align: center
</style> </style>

View file

@ -2,6 +2,7 @@ import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import store from "../store"; import store from "../store";
import Login from "../views/Login.vue"; import Login from "../views/Login.vue";
import NotFound from "../views/NotFound.vue";
import Home from "../views/Home.vue"; import Home from "../views/Home.vue";
import History from "../views/History.vue"; import History from "../views/History.vue";
@ -42,6 +43,11 @@ const routes = [
store.dispatch("logout"); store.dispatch("logout");
next("/"); next("/");
} }
},
{
path: "*",
name: "NotFound",
component: NotFound
} }
]; ];

17
src/views/NotFound.vue Normal file
View file

@ -0,0 +1,17 @@
<template>
<LayoutMinimal center title="Couldn't find what you were looking for :(">
404
</LayoutMinimal>
</template>
<script>
// @ is an alias to /src
import LayoutMinimal from "@/components/layout/LayoutMinimal";
export default {
name: "NotFound",
components: {
LayoutMinimal
}
};
</script>