feat: create custom error page, wip
This commit is contained in:
parent
1783928c36
commit
582435a3c7
1 changed files with 29 additions and 0 deletions
29
error.vue
Normal file
29
error.vue
Normal file
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div id="error-container">
|
||||
<h2>{{ error?.statusCode }}</h2>
|
||||
<p>{{ error?.message }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { NuxtError } from '#app';
|
||||
|
||||
const props = defineProps({
|
||||
error: Object as () => NuxtError
|
||||
});
|
||||
|
||||
if (props.error?.statusCode == 401) {
|
||||
console.log("HELLO THERE");
|
||||
clearError({ redirect: `/login?redirect_to=${useRoute().fullPath}` });
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
#error-container {
|
||||
text-align: center;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue