forked from bcgov/bcregistry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.vue
47 lines (44 loc) · 873 Bytes
/
error.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<!-- don't display component errors -->
<v-app dark>
<template v-if="error.statusCode !== 500">
<h1 v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
<h1 v-else>
{{ otherError }}
</h1>
<NuxtLink to="/"> Home page </NuxtLink>
</template>
</v-app>
</template>
<script>
export default {
layout: 'empty',
props: {
error: {
type: Object,
default: null,
},
},
data () {
return {
pageNotFound: '404 Not Found',
otherError: 'An error occurred',
}
},
head () {
switch (this.error.statusCode) {
case 404: return { title: this.pageNotFound }
case 500: return {}
default: return { title: this.otherError }
}
},
}
</script>
<style lang="scss" scoped>
@import '@/assets/scss/theme.scss';
h1 {
font-size: $px-20;
}
</style>