NotFound.vue 1.36 KB
<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push('/home');
};
</script>

<template>
  <div class="not-found-page">
    <div class="not-found-content">
      <div class="error-code">404</div>
      <h2 class="error-title">页面未找到</h2>
      <p class="error-desc">抱歉,您访问的页面不存在</p>
      <button class="back-button" @click="goHome">返回首页</button>
    </div>
  </div>
</template>

<style scoped>
.not-found-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #eff2ff 0%, #f6edff 100%);
}

.not-found-content {
  color: #383838;
  text-align: center;
}

.error-code {
  margin-bottom: 24px;
  font-size: 120px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 4px 8px rgb(0 0 0 / 20%);
}

.error-title {
  margin-bottom: 16px;
  font-size: 32px;
  font-weight: 600;
}

.error-desc {
  margin-bottom: 32px;
  font-size: 16px;
  opacity: 0.9;
}

.back-button {
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 500;
  color: #667eea;
  cursor: pointer;
  background: #fff;
  border: none;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
  transition: all 0.3s;
}

.back-button:hover {
  box-shadow: 0 6px 16px rgb(0 0 0 / 20%);
  transform: translateY(-2px);
}
</style>