error.vue 662 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 =
  31. this.error.statusCode === 404 ? this.pageNotFound : this.otherError
  32. return {
  33. title
  34. }
  35. }
  36. }
  37. </script>
  38. <style scoped>
  39. h1 {
  40. font-size: 20px;
  41. }
  42. </style>