feat: add error page

This commit is contained in:
kmacoders
2021-06-28 01:07:31 +07:00
parent f79c2f5031
commit 7eb7e72c55
6 changed files with 135 additions and 3 deletions

12
layouts/basic.vue Normal file
View File

@@ -0,0 +1,12 @@
<template>
<div>
<nuxt />
</div>
</template>
<script>
import { Vue, Component } from 'nuxt-property-decorator'
@Component
export default class BasicLayout extends Vue {}
</script>

42
layouts/error.vue Normal file
View File

@@ -0,0 +1,42 @@
<template>
<div class="error-page-container">
<h1 class="">404</h1>
<div v-if="error.statusCode === 404">
Oop! Nothing was found
</div>
<div v-else>An error occurred</div>
<NuxtLink
to="/"
class="btn"
>
Go Back
</NuxtLink>
</div>
</template>
<script>
import { Vue, Component, Prop } from 'nuxt-property-decorator'
@Component({
layout: 'basic'
})
export default class ErrorLayout extends Vue {
@Prop() error;
}
</script>
<style>
.error-page-container {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
h1 {
font-size: 6.5rem;
}
</style>