NotFound.vue
1.5 KB
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
<template>
<div class="notfound-view">
<div class="content-card">
<div class="error-code">
404
</div>
<h1>页面未找到</h1>
<p>抱歉,您访问的页面不存在或已被删除</p>
<button class="btn-home" @click="goHome">
🏠 返回首页
</button>
</div>
</div>
</template>
<script setup lang="ts">
import { useRouter } from "vue-router";
const router = useRouter();
const goHome = () => {
router.push("/");
};
</script>
<style scoped>
.notfound-view {
display: flex;
align-items: center;
justify-content: center;
max-width: 600px;
min-height: 400px;
margin: 0 auto;
}
.content-card {
padding: 3rem;
text-align: center;
background: rgb(255 255 255 / 10%);
border: 1px solid rgb(255 255 255 / 20%);
border-radius: 1rem;
backdrop-filter: blur(10px);
}
.error-code {
margin-bottom: 1rem;
font-size: 6rem;
font-weight: 700;
background: linear-gradient(45deg, #fff, rgb(255 255 255 / 60%));
background-clip: text;
-webkit-text-fill-color: transparent;
}
.content-card h1 {
margin: 0 0 1rem;
font-size: 2rem;
}
.content-card p {
margin: 0 0 2rem;
opacity: 0.9;
}
.btn-home {
padding: 0.75rem 2rem;
font-size: 1rem;
font-weight: 600;
color: white;
cursor: pointer;
background: rgb(76 175 80 / 80%);
border: none;
border-radius: 0.5rem;
transition: all 0.3s ease;
}
.btn-home:hover {
background: rgb(76 175 80 / 100%);
transform: translateY(-2px);
}
</style>