error.vue 772 B

1234567891011121314151617181920212223242526272829303132333435
  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(process.client && props.error.statusCode === 404 && process.env.NODE_ENV === 'production') {
  20. const runtimeConfig = useRuntimeConfig()
  21. navigateTo(UrlUtils.join(runtimeConfig.baseUrlAdminLegacy, 'dashboard'), {external: true})
  22. }
  23. const otherError = ref('Une erreur est parvenue')
  24. </script>
  25. <style scoped>
  26. h1 {
  27. font-size: 20px;
  28. }
  29. </style>