error.vue 687 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <v-app dark>
  3. <h1 v-if="error.statusCode !== 404">
  4. {{ otherError }}
  5. </h1>
  6. </v-app>
  7. </template>
  8. <script lang="ts">
  9. import { defineComponent, useContext} from '@nuxtjs/composition-api'
  10. export default defineComponent({
  11. props: {
  12. error: {
  13. type: Object,
  14. default: null
  15. }
  16. },
  17. setup (props) {
  18. const {$config} = useContext()
  19. const baseLegacyUrl:string = $config.baseURL_adminLegacy
  20. if(process.client && props.error.statusCode === 404)
  21. window.location.href= `${baseLegacyUrl}/dashboard`
  22. return {
  23. otherError: 'Une erreur est parvenue'
  24. }
  25. }
  26. })
  27. </script>
  28. <style scoped>
  29. h1 {
  30. font-size: 20px;
  31. }
  32. </style>