error.vue 653 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <v-app dark>
  3. <h1 v-if="error.statusCode !== 404">
  4. {{ otherError }}
  5. </h1>
  6. </v-app>
  7. </template>
  8. <script setup lang="ts">
  9. import UrlUtils from "~/services/utils/urlUtils";
  10. const props = defineProps({
  11. error: {
  12. type: Object,
  13. default: null
  14. }
  15. })
  16. if(process.client && props.error.statusCode === 404 && process.env.NODE_ENV === 'production') {
  17. const runtimeConfig = useRuntimeConfig()
  18. navigateTo(UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, 'dashboard'), {external: true})
  19. }
  20. const otherError = ref('Une erreur est parvenue')
  21. </script>
  22. <style scoped>
  23. h1 {
  24. font-size: 20px;
  25. }
  26. </style>