App.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div id="app">
  3. <div class="top">
  4. <span>测试</span>
  5. </div>
  6. <div class="center">
  7. <div class="left">
  8. <Nav />
  9. </div>
  10. <div class="right">
  11. <keep-alive>
  12. <router-view />
  13. </keep-alive>
  14. </div>
  15. <div
  16. v-if="showLoading"
  17. class="loading"
  18. >
  19. <Loading />
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import Nav from './components/Nav.vue'
  26. import Loading from '@/components/loading.vue'
  27. export default {
  28. components: { Nav, Loading },
  29. computed: {
  30. showLoading() {
  31. return this.$store.getters.GetLoading
  32. }
  33. },
  34. mounted() {
  35. // 通知主进程是否完成渲染
  36. const electron = window.$electron || null
  37. if (electron) {
  38. electron.ipcRenderer.send('close-loading')
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="less" scoped>
  44. #app {
  45. font-family: Avenir, Helvetica, Arial, sans-serif;
  46. -webkit-font-smoothing: antialiased;
  47. -moz-osx-font-smoothing: grayscale;
  48. text-align: center;
  49. color: white;
  50. width: 100%;
  51. height: 100%;
  52. min-width: 1620px;
  53. min-height: 900px;
  54. // max-width: 1920px;
  55. // max-height: 1080px;
  56. background: black;
  57. margin: 0;
  58. padding: 0;
  59. .top {
  60. width: 100%;
  61. height: 60px;
  62. margin-bottom: 10px;
  63. background: #202532;
  64. display: flex;
  65. align-items: center;
  66. justify-content: center;
  67. font-size: 24px;
  68. font-weight: bold;
  69. position: relative;
  70. svg {
  71. width: 200px;
  72. height: 50px;
  73. position: absolute;
  74. left: 0;
  75. }
  76. }
  77. .center {
  78. display: flex;
  79. height: calc(100% - 70px);
  80. width: 100%;
  81. position: relative;
  82. overflow: hidden;
  83. & > div {
  84. height: 100%;
  85. }
  86. .left {
  87. margin-right: 10px;
  88. }
  89. .right {
  90. flex: 1;
  91. width: calc(100% - 220px);
  92. position: relative;
  93. }
  94. .loading {
  95. position: absolute;
  96. width: 100%;
  97. height: 100%;
  98. top: 0;
  99. left: 0;
  100. z-index: 9999;
  101. background: rgba(0, 0, 0, 0.5);
  102. display: flex;
  103. align-items: center;
  104. justify-content: center;
  105. }
  106. }
  107. }
  108. </style>
  109. <style>
  110. html,
  111. body {
  112. padding: 0;
  113. margin: 0;
  114. width: 100%;
  115. height: 100%;
  116. user-select: none;
  117. }
  118. /* 隐藏滚动条 */
  119. ::-webkit-scrollbar {
  120. width: 0 !important;
  121. display: none;
  122. }
  123. /*在谷歌下移除input[number]的上下箭头*/
  124. input[type="number"]::-webkit-outer-spin-button,
  125. input[type="number"]::-webkit-inner-spin-button {
  126. -webkit-appearance: none !important;
  127. margin: 0;
  128. }
  129. </style>