error.vue 688 B

1234567891011121314151617181920212223242526272829303132
  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 {navigateTo} from "#app";
  10. import UrlUtils from "~/services/utils/urlUtils";
  11. const props = defineProps({
  12. error: {
  13. type: Object,
  14. default: null
  15. }
  16. })
  17. if(process.client && props.error.statusCode === 404 && process.env.NODE_ENV === 'production') {
  18. const runtimeConfig = useRuntimeConfig()
  19. navigateTo(UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, 'dashboard'), {external: true})
  20. }
  21. const otherError = ref('Une erreur est parvenue')
  22. </script>
  23. <style scoped>
  24. h1 {
  25. font-size: 20px;
  26. }
  27. </style>