it-tools/layouts/error.vue

45 lines
660 B
Vue
Raw Normal View History

2020-12-21 22:06:13 +01:00
<template>
<v-app dark>
<h1 v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
<h1 v-else>
{{ otherError }}
</h1>
2020-12-21 22:49:27 +01:00
<NuxtLink to="/">
Home page
</NuxtLink>
2020-12-21 22:06:13 +01:00
</v-app>
</template>
<script>
export default {
layout: 'empty',
props: {
error: {
type: Object,
2020-12-21 22:49:27 +01:00
default: null
}
2020-12-21 22:06:13 +01:00
},
data() {
return {
pageNotFound: '404 Not Found',
2020-12-21 22:49:27 +01:00
otherError: 'An error occurred'
2020-12-21 22:06:13 +01:00
}
},
head() {
const title =
this.error.statusCode === 404 ? this.pageNotFound : this.otherError
return {
2020-12-21 22:49:27 +01:00
title
2020-12-21 22:06:13 +01:00
}
2020-12-21 22:49:27 +01:00
}
2020-12-21 22:06:13 +01:00
}
</script>
<style scoped>
h1 {
font-size: 20px;
}
</style>