Add error page
This commit is contained in:
parent
81bfed6710
commit
0418315f4d
6 changed files with 171 additions and 87 deletions
50
error.vue
Normal file
50
error.vue
Normal file
|
@ -0,0 +1,50 @@
|
|||
<template>
|
||||
|
||||
<div class="app">
|
||||
<AppError class="app__error" @handle-error="handleError" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
// --------------------------------------------------
|
||||
// DATA
|
||||
// --------------------------------------------------
|
||||
|
||||
const props = defineProps({
|
||||
error: Object
|
||||
});
|
||||
const pageTitleChunk = `Erreur ${props.error.statusCode}`;
|
||||
|
||||
// --------------------------------------------------
|
||||
// HEAD
|
||||
// --------------------------------------------------
|
||||
|
||||
useAppHead(pageTitleChunk);
|
||||
|
||||
// --------------------------------------------------
|
||||
// LOGIC
|
||||
// --------------------------------------------------
|
||||
|
||||
const handleError = () => {
|
||||
clearError({ redirect: '/' });
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
// --------------------------------------------------
|
||||
// LAYOUT
|
||||
// --------------------------------------------------
|
||||
|
||||
.app {
|
||||
|
||||
&__error {
|
||||
grid-area: app-main;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue