404.vue 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div class="not-found">
  3. <div class="not-found-content">
  4. <div class="error-code">404</div>
  5. <h2>页面不存在</h2>
  6. <p>您访问的页面不存在,请检查链接是否正确</p>
  7. <el-button type="primary" @click="goHome">返回首页</el-button>
  8. </div>
  9. </div>
  10. </template>
  11. <script setup>
  12. import { useRouter } from 'vue-router'
  13. const router = useRouter()
  14. function goHome() {
  15. router.replace('/')
  16. }
  17. </script>
  18. <style lang="scss" scoped>
  19. .not-found {
  20. width: 100vw;
  21. height: 100vh;
  22. display: flex;
  23. align-items: center;
  24. justify-content: center;
  25. background: #f0f2f5;
  26. }
  27. .not-found-content {
  28. text-align: center;
  29. .error-code {
  30. font-size: 120px;
  31. font-weight: 700;
  32. color: #1890ff;
  33. line-height: 1;
  34. margin-bottom: 16px;
  35. opacity: 0.4;
  36. }
  37. h2 { font-size: 24px; color: #262626; margin-bottom: 12px; }
  38. p { color: #8c8c8c; margin-bottom: 24px; }
  39. }
  40. </style>