404.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class="error layout-padding">
  3. <div class="layout-padding-auto layout-padding-view">
  4. <div class="error-flex">
  5. <div class="left">
  6. <div class="left-item">
  7. <div class="left-item-animation left-item-num">404</div>
  8. <div class="left-item-animation left-item-title">当前地址未找到~</div>
  9. <div class="left-item-animation left-item-msg">您可以先检查网址,然后重新填写或给我们反馈问题。</div>
  10. <div class="left-item-animation left-item-btn">
  11. <el-button type="primary" round @click="onGoHome">返回首页</el-button>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="right">
  16. <img :src="getImageUrl('public/404.png')" alt="" />
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup lang="ts" name="404">
  23. import { useRouter } from 'vue-router';
  24. import { getImageUrl } from '@/utils/tools';
  25. // 定义变量内容
  26. const router = useRouter();
  27. // 返回首页
  28. const onGoHome = () => {
  29. router.push('/');
  30. };
  31. </script>
  32. <style scoped lang="scss">
  33. .error {
  34. height: 100%;
  35. .error-flex {
  36. margin: auto;
  37. display: flex;
  38. height: 350px;
  39. width: 900px;
  40. .left {
  41. flex: 1;
  42. height: 100%;
  43. align-items: center;
  44. display: flex;
  45. .left-item {
  46. .left-item-animation {
  47. opacity: 0;
  48. animation-name: error-num;
  49. animation-duration: 0.5s;
  50. animation-fill-mode: forwards;
  51. }
  52. .left-item-num {
  53. color: var(--el-color-info);
  54. font-size: 55px;
  55. }
  56. .left-item-title {
  57. font-size: 20px;
  58. color: var(--el-text-color-primary);
  59. margin: 15px 0 5px 0;
  60. animation-delay: 0.1s;
  61. }
  62. .left-item-msg {
  63. color: var(--el-text-color-secondary);
  64. font-size: 12px;
  65. margin-bottom: 20px;
  66. animation-delay: 0.2s;
  67. }
  68. .left-item-btn {
  69. animation-delay: 0.2s;
  70. }
  71. }
  72. }
  73. .right {
  74. flex: 1;
  75. opacity: 0;
  76. animation-name: error-img;
  77. animation-duration: 2s;
  78. animation-fill-mode: forwards;
  79. display: flex;
  80. align-items: center;
  81. justify-content: center;
  82. }
  83. }
  84. }
  85. </style>