error.vue 659 B

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