mealie/frontend/layouts/error.vue

42 lines
653 B
Vue
Raw Normal View History

2021-07-31 22:00:28 +00:00
<template>
<v-app dark>
<h1 v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
<h1 v-else>
{{ otherError }}
</h1>
2021-08-02 03:24:47 +00:00
<NuxtLink to="/"> Home page </NuxtLink>
2021-07-31 22:00:28 +00:00
</v-app>
</template>
<script>
export default {
2021-08-02 03:24:47 +00:00
layout: "empty",
2021-07-31 22:00:28 +00:00
props: {
error: {
type: Object,
2021-08-02 03:24:47 +00:00
default: null,
},
2021-07-31 22:00:28 +00:00
},
2021-08-02 03:24:47 +00:00
data() {
2021-07-31 22:00:28 +00:00
return {
2021-08-02 03:24:47 +00:00
pageNotFound: "404 Not Found",
otherError: "An error occurred",
};
2021-07-31 22:00:28 +00:00
},
2021-08-02 03:24:47 +00:00
head() {
const title = this.error.statusCode === 404 ? this.pageNotFound : this.otherError;
2021-07-31 22:00:28 +00:00
return {
2021-08-02 03:24:47 +00:00
title,
};
},
};
2021-07-31 22:00:28 +00:00
</script>
<style scoped>
h1 {
font-size: 20px;
}
</style>