App.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div id='app'>
  3. <router-view />
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {}
  10. },
  11. mounted() {
  12. // 监听页面刷新事件
  13. window.addEventListener('unload', this.unload)
  14. // 页面加载完成后,移除session里的存储的信息
  15. window.addEventListener('load', this.load)
  16. },
  17. methods: {
  18. unload() {
  19. // const { userInfo, projectId, menuStatus,manualAutoMode } = this.$store.state;
  20. const state = this.$store.state
  21. sessionStorage.setItem('state', JSON.stringify(state))
  22. },
  23. load() {
  24. sessionStorage.clear()
  25. }
  26. }
  27. }
  28. </script>
  29. <style lang="less">
  30. body,
  31. h1,
  32. h2,
  33. h3,
  34. h4,
  35. h5,
  36. h6,
  37. hr,
  38. p,
  39. blockquote,
  40. dl,
  41. dt,
  42. dd,
  43. ul,
  44. ol,
  45. li,
  46. pre,
  47. form,
  48. fieldset,
  49. legend,
  50. button,
  51. input,
  52. textarea,
  53. th,
  54. td {
  55. margin: 0;
  56. padding: 0;
  57. }
  58. body,
  59. button,
  60. input,
  61. select,
  62. textarea {
  63. font: 12px/1.5 Arial, 'Microsoft YaHei', '\65b0\5b8b\4f53';
  64. }
  65. h1,
  66. h2,
  67. h3,
  68. h4,
  69. h5,
  70. h6 {
  71. font-size: 100%;
  72. }
  73. address,
  74. cite,
  75. dfn,
  76. var,
  77. em,
  78. i,
  79. u {
  80. font-style: normal;
  81. }
  82. ol,
  83. ul {
  84. list-style: none;
  85. }
  86. a {
  87. text-decoration: none;
  88. }
  89. a:hover {
  90. text-decoration: underline;
  91. }
  92. img {
  93. border: none;
  94. vertical-align: middle;
  95. }
  96. :focus {
  97. outline: 0;
  98. }
  99. button,
  100. input,
  101. select,
  102. textarea {
  103. font-size: 100%;
  104. }
  105. table {
  106. border-collapse: collapse;
  107. border-spacing: 0;
  108. }
  109. /* 滚动条样式 */
  110. body ::-webkit-scrollbar {
  111. width: 5px;
  112. height: 5px;
  113. }
  114. body ::-webkit-scrollbar-track {
  115. background-color: rgba(0, 0, 0, 0);
  116. border-radius: 3px;
  117. }
  118. body ::-webkit-scrollbar-thumb {
  119. border-radius: 3px;
  120. background: #e6e6e6;
  121. border: 1px solid #e6e6e6;
  122. }
  123. body ::-webkit-scrollbar-thumb:vertical:hover {
  124. background: #e6e6e6;
  125. border: 1px solid #e6e6e6;
  126. }
  127. .clearfix::after {
  128. content: '.';
  129. display: block;
  130. height: 0;
  131. clear: both;
  132. visibility: hidden;
  133. }
  134. .clearfix {
  135. zoom: 1;
  136. }
  137. .left {
  138. float: left;
  139. }
  140. .right {
  141. float: right;
  142. }
  143. html,
  144. body {
  145. width: 100%;
  146. height: 100%;
  147. // min-width: 1920px;
  148. // background: url('./assets/images/back.jpg') no-repeat;
  149. }
  150. #app {
  151. height: 100%;
  152. width: 100%;
  153. }
  154. </style>