App.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <!-- <router-view /> -->
  3. <router-view v-slot="{ Component }">
  4. <transition
  5. name="fade-in-out"
  6. >
  7. <component
  8. :is="Component"
  9. />
  10. </transition>
  11. </router-view>
  12. </template>
  13. <script setup>
  14. import { ref, computed, watch, onMounted } from "vue"
  15. import { useRoute, useRouter } from "vue-router"
  16. import { useStore } from "vuex"
  17. import {
  18. // checkLoginStatusAndProcess,
  19. // getUserFromStorageIfNeed
  20. } from '@/api.js'
  21. const route = useRoute()
  22. const router = useRouter()
  23. const store = useStore()
  24. // store.commit('getPageVisitRecordFromStorage')
  25. // checkLoginStatusAndProcess()
  26. // getUserFromStorageIfNeed()
  27. // if (store.state.loginStatus === store.getters.loginStatusEnum.notLogin && route.name !== 'LoginView') {
  28. // router.push({
  29. // name: 'LoginView',
  30. // query: {
  31. // redirect: encodeURI(route.fullPath)
  32. // }
  33. // })
  34. // }
  35. </script>
  36. <style lang="less">
  37. html, body {
  38. // overscroll-behavior: none;
  39. overflow: hidden;
  40. height: 100%;
  41. }
  42. * {
  43. user-select: none;
  44. -webkit-touch-callout: none;
  45. }
  46. // 360浏览器不支持not()
  47. input, textarea {
  48. user-select: initial;
  49. }
  50. #app {
  51. height: 100%;
  52. }
  53. // 字体
  54. @font-face {
  55. font-family: 'KingHwa_OldSong';
  56. src: url('@/assets/style/KingHwa_OldSong.TTF');
  57. }
  58. @font-face {
  59. font-family: 'KaiTi';
  60. src: url('@/assets/style/SIMKAI.TTF');
  61. }
  62. // i {
  63. // font-style: italic;
  64. // }
  65. // 滚动条,只设置某一项可能导致不生效。
  66. // ::-webkit-scrollbar { background: #dddecc; width: 6px; height: 6px; }
  67. // ::-webkit-scrollbar-thumb { background: #828a5b; border-radius: 3px; }
  68. // ::-webkit-scrollbar-corner { background: #dddecc; }
  69. // vue组件过渡效果
  70. .fade-out-leave-active {
  71. transition: opacity 2s;
  72. pointer-events: none;
  73. }
  74. .fade-out-leave-to {
  75. opacity: 0;
  76. }
  77. .fade-in-enter-active {
  78. transition: opacity 2s;
  79. }
  80. .fade-in-enter-from {
  81. opacity: 0;
  82. }
  83. .fade-in-out-enter-active {
  84. transition: opacity 1s;
  85. }
  86. .fade-in-out-leave-active {
  87. transition: opacity 1s;
  88. pointer-events: none;
  89. }
  90. .fade-in-out-enter-from {
  91. opacity: 0;
  92. }
  93. .fade-in-out-leave-to {
  94. opacity: 0;
  95. }
  96. // 不断渐变显隐 animation
  97. .animation-show-hide {
  98. animation: show-hide 1.5s infinite;
  99. }
  100. @keyframes show-hide {
  101. 0% {
  102. opacity: 0;
  103. }
  104. 50% {
  105. opacity: 1;
  106. }
  107. 100% {
  108. opacity: 0;
  109. }
  110. }
  111. // 不断渐变显隐,显示时间较长 animation
  112. .animation-show-long-hide {
  113. animation: show-long-hide 2.5s infinite;
  114. }
  115. @keyframes show-long-hide {
  116. 0% {
  117. opacity: 0;
  118. }
  119. 35% {
  120. opacity: 1;
  121. }
  122. 65% {
  123. opacity: 1;
  124. }
  125. 100% {
  126. opacity: 0;
  127. }
  128. }
  129. // // vue-viewer
  130. .viewer-backdrop {
  131. background-color: rgba(0, 0, 0, 90%) !important;
  132. }
  133. </style>