50 lines
1.2 KiB
Vue
50 lines
1.2 KiB
Vue
<!-- ============================================================
|
||
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> |