App.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div>
  3. <router-view/>
  4. <global-message></global-message>
  5. </div>
  6. </template>
  7. <script>
  8. import GlobalMessage from '@/components/GlobalMessage'
  9. export default {
  10. components: { GlobalMessage },
  11. data () {
  12. return {
  13. userInfo: {}
  14. }
  15. },
  16. created () {
  17. // 在页面加载时读取sessionStorage里的状态信息
  18. if (sessionStorage.getItem('store')) {
  19. this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('store'))))
  20. }
  21. // 在页面刷新时将vuex里的信息保存到sessionStorage里
  22. window.addEventListener('beforeunload', () => {
  23. sessionStorage.setItem('store', JSON.stringify(this.$store.state))
  24. })
  25. }
  26. }
  27. </script>
  28. <style lang="scss">
  29. @import "~@/style/reset.scss";
  30. @import "~@/style/theme.scss";
  31. @font-face {
  32. font-family: 'iconfont'; /* project id 1598214 */
  33. src: url('//at.alicdn.com/t/font_1598214_qpa79fv4wuj.eot');
  34. src: url('//at.alicdn.com/t/font_1598214_qpa79fv4wuj.eot?#iefix') format('embedded-opentype'),
  35. url('//at.alicdn.com/t/font_1598214_qpa79fv4wuj.woff2') format('woff2'),
  36. url('//at.alicdn.com/t/font_1598214_qpa79fv4wuj.woff') format('woff'),
  37. url('//at.alicdn.com/t/font_1598214_qpa79fv4wuj.ttf') format('truetype'),
  38. url('//at.alicdn.com/t/font_1598214_qpa79fv4wuj.svg#iconfont') format('svg');
  39. }
  40. body {
  41. color: #3a4a5a;
  42. }
  43. * {
  44. -webkit-tap-highlight-color: transparent;
  45. }
  46. .title {
  47. font-size: 28px;
  48. font-weight: bold;
  49. margin-bottom: 24px;
  50. }
  51. .sub-title {
  52. font-size: 22px;
  53. font-weight: bold;
  54. margin-bottom: 12px;
  55. }
  56. .no-content-warning {
  57. color: #aabaca;
  58. font-size: 20px;
  59. font-weight: bold;
  60. padding: 12px 0;
  61. height: 120px;
  62. display: flex;
  63. flex-direction: column;
  64. justify-content: center;
  65. line-height: 1.8;
  66. .no-content-warning-tip {
  67. padding: 24px 0;
  68. }
  69. }
  70. .tag {
  71. display: inline-block;
  72. position: relative;
  73. background-color: lighten($theme-blue, 30);
  74. color: $theme-blue;
  75. font-size: 12px;
  76. padding: 2px 8px;
  77. margin-left: 4px;
  78. border-radius: 8px;
  79. vertical-align: middle;
  80. bottom: 2px;
  81. }
  82. .full-width {
  83. width: 100%;
  84. }
  85. .mb-8 {
  86. margin-bottom: 8px;
  87. }
  88. .mb-12 {
  89. margin-bottom: 12px;
  90. }
  91. .mb-16 {
  92. margin-bottom: 16px;
  93. }
  94. .mb-24 {
  95. margin-bottom: 24px;
  96. }
  97. .mb-32 {
  98. margin-bottom: 32px;
  99. }
  100. .mt-8 {
  101. margin-top: 8px;
  102. }
  103. .mt-16 {
  104. margin-top: 16px;
  105. }
  106. .mt-24 {
  107. margin-top: 16px;
  108. }
  109. .mt-32 {
  110. margin-top: 16px;
  111. }
  112. </style>