error.vue 654 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <v-app dark>
  3. <h1 v-if="error.statusCode === 404">
  4. {{ pageNotFound }}
  5. </h1>
  6. <h1 v-else>
  7. {{ otherError }}
  8. </h1>
  9. <NuxtLink to="/">
  10. Home page
  11. </NuxtLink>
  12. </v-app>
  13. </template>
  14. <script>
  15. export default {
  16. layout: 'empty',
  17. props: {
  18. error: {
  19. type: Object,
  20. default: null
  21. }
  22. },
  23. data() {
  24. return {
  25. pageNotFound: '404 Not Found',
  26. otherError: 'An error occurred'
  27. }
  28. },
  29. head() {
  30. const title = this.error.statusCode === 404 ? this.pageNotFound : this.otherError
  31. return {
  32. title
  33. }
  34. }
  35. }
  36. </script>
  37. <style scoped>
  38. h1 {
  39. font-size: 20px;
  40. }
  41. </style>