chore: 前端首次基线提交
运行必须源码:src/、public/、index.html、package.json 及构建配置。 已忽略运行非必须:node_modules/、dist/、.env*。
This commit is contained in:
50
src/views/NotFound.vue
Normal file
50
src/views/NotFound.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<!-- ============================================================
|
||||
NotFound.vue — 404 页面未找到
|
||||
当用户访问未定义的路由时显示此页面
|
||||
============================================================ -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<el-card shadow="hover">
|
||||
<div class="text-center" style="padding: 60px 20px;">
|
||||
<h1 style="font-size: 72px; color: #c9a84c; margin: 0;">404</h1>
|
||||
<p style="font-size: 18px; margin: 20px 0; color: #606266;">
|
||||
抱歉,您访问的页面不存在
|
||||
</p>
|
||||
<el-button type="primary" size="large" @click="goHome">
|
||||
返回首页
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* NotFound.vue — 404 页面未找到视图
|
||||
* 当用户访问未定义的路由时显示此页面
|
||||
*/
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
/**
|
||||
* 返回首页
|
||||
*/
|
||||
function goHome() {
|
||||
router.push('/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 60vh;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user