error.vue 766 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. import { useLayoutStore } from '~/stores/layout'
  11. const layoutStore = useLayoutStore()
  12. layoutStore.name = 'error'
  13. const props = defineProps({
  14. error: {
  15. type: Object,
  16. default: null,
  17. },
  18. })
  19. if (
  20. import.meta.client &&
  21. props.error.statusCode === 404 &&
  22. process.env.NODE_ENV === 'production'
  23. ) {
  24. const runtimeConfig = useRuntimeConfig()
  25. navigateTo(UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, 'dashboard'), {
  26. external: true,
  27. })
  28. }
  29. const otherError = ref('Une erreur est parvenue')
  30. </script>
  31. <style scoped>
  32. h1 {
  33. font-size: 20px;
  34. }
  35. </style>