NotFound.vue
1.66 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
<!--
* @Date: 2025-10-30 10:32:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-11-01 21:08:44
* @FilePath: /stdj_h5/src/views/NotFound.vue
* @Description: 文件描述
-->
<template>
<div class="not-found-container">
<div class="not-found-content">
<!-- 404 图标 -->
<div class="not-found-icon">
<svg viewBox="0 0 200 200" class="w-32 h-32 text-gray-300">
<circle cx="100" cy="100" r="90" fill="none" stroke="currentColor" stroke-width="4"/>
<text x="100" y="120" text-anchor="middle" font-size="48" font-weight="bold" fill="currentColor">404</text>
</svg>
</div>
<!-- 错误信息 -->
<div class="not-found-text">
<h1 class="text-2xl font-bold text-gray-800 mb-2">页面不存在</h1>
<p class="text-gray-600 mb-8">抱歉,您访问的页面不存在或已被删除</p>
</div>
</div>
</div>
</template>
<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
// 返回首页
const goHome = () => {
router.push('/')
}
// 返回上一页
const goBack = () => {
if (window.history.length > 1) {
router.back()
} else {
router.push('/')
}
}
</script>
<style scoped>
.not-found-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
.not-found-content {
text-align: center;
max-width: 400px;
width: 100%;
}
.not-found-icon {
margin-bottom: 2rem;
}
.suggested-links {
background: white;
border-radius: 12px;
padding: 16px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
</style>