error.vue 685 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. name: 'EmptyLayout',
  17. layout: 'empty',
  18. props: {
  19. error: {
  20. type: Object,
  21. default: null
  22. }
  23. },
  24. data () {
  25. return {
  26. pageNotFound: '404 Not Found',
  27. otherError: 'An error occurred'
  28. }
  29. },
  30. head () {
  31. const title =
  32. this.error.statusCode === 404 ? this.pageNotFound : this.otherError
  33. return {
  34. title
  35. }
  36. }
  37. }
  38. </script>
  39. <style scoped>
  40. h1 {
  41. font-size: 20px;
  42. }
  43. </style>