-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.vue
80 lines (66 loc) · 1.79 KB
/
error.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<script setup lang="ts">
import type { NuxtError } from '#app'
import SectionCommon from '~/components/sections/common/SectionCommon.vue';
useHead({
script: [
{ src: 'https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js'}
]
})
const props = defineProps({
error: Object as () => NuxtError
})
const { finish } = useLoadingIndicator()
finish({ force: true })
const handleError = () => clearError({ redirect: '/' })
</script>
<template>
<nuxt-layout>
<section-common>
<template #header>
Ошибка {{ error.statusCode }}
</template>
</section-common>
<section class="section-error">
<div class="container">
<div class="col">
<div class="message-container">
<lottie-player src="/animation/error.json" background="transparent" speed="1" style="width: 150px; height: 150px;" loop autoplay></lottie-player>
<div class="title-h5 message">{{ error?.message }}</div>
<p>Попробуйте сделать другой запрос или вы можете</p>
<insane-button type="button" variant="primary" @click="handleError">Вернуться на главную страницу</insane-button>
</div>
</div>
</div>
</section>
</nuxt-layout>
</template>
<style scoped lang="scss">
.section-error {
padding-bottom: 50px;
}
.message-container {
margin-bottom: 40px;
@media (max-width: 768px) {
padding: 0 20px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
}
.message {
margin-bottom: 8px;
}
lottie-player {
margin-right: 20px;
display: inline;
float: left;
@media (max-width: 768px) {
margin-right: 0;
margin-bottom: 20px;
}
}
.insane-button {
margin-top: 30px;
}
</style>