App.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div>
  3. <keep-alive>
  4. <router-view v-if="$route.meta.keepAlive"></router-view>
  5. </keep-alive>
  6. <router-view v-if="!$route.meta.keepAlive"></router-view>
  7. </div>
  8. </template>
  9. <script>
  10. import $ from 'jquery'
  11. export default {
  12. name: "app",
  13. created() { },
  14. mounted() {
  15. let width=$("body").width();
  16. console.log(width)
  17. if(width>=1200){
  18. let fontsize=width/1920*40;//fontsize为当前屏幕的基数字体,相对于设计稿计算得到的。
  19. $("html").css("font-size",`${fontsize}px`)
  20. }
  21. if(width<=750){
  22. let fontsize=width/400*40;
  23. $("html").css("font-size",`${fontsize}px`)
  24. }
  25. //当加载页面的时候设置生效
  26. window.onresize = () => {
  27. return (() => {
  28. let width=$("body").width();
  29. if(width>=1200){
  30. let fontsize=width/1920*40;
  31. $("html").css("font-size",`${fontsize}px`)
  32. }
  33. if(width<=750){
  34. let fontsize=width/400*40;
  35. $("html").css("font-size",`${fontsize}px`)
  36. }
  37. })()
  38. }
  39. }
  40. };
  41. </script>
  42. <style>
  43. .popupDiv {
  44. background: #F4F4F4;
  45. position: relative;
  46. height: 100%;
  47. width: 100%;
  48. display: flex;
  49. flex-direction: column;
  50. }
  51. .popupSearch {
  52. width: 100%;
  53. }
  54. .popupCon {
  55. width: 100%;
  56. overflow: auto;
  57. position: relative;
  58. }
  59. .paddingDiv {
  60. box-sizing: border-box;
  61. margin: 0 15px;
  62. }
  63. .popupTitle {
  64. color: #333333;
  65. padding: 0 30px;
  66. position: relative;
  67. line-height: 20px;
  68. }
  69. .popupTitle::after {
  70. content: '';
  71. width: 3px;
  72. height: 100%;
  73. border-radius: 3px;
  74. background: #409eff;
  75. position: absolute;
  76. top: 0;
  77. left: 15px;
  78. }
  79. .popupItem {
  80. background: #FFFFFF;
  81. padding: 10px 10px;
  82. border-radius: 6px;
  83. margin-top: 14px;
  84. position: relative;
  85. }
  86. .marginTop {
  87. margin-top: 15px;
  88. }
  89. .paddingTop {
  90. padding-top: 10px;
  91. }
  92. .popupItem p {
  93. width: 100%;
  94. overflow: hidden;
  95. white-space:nowrap;
  96. text-overflow: ellipsis;
  97. line-height: 22px;
  98. }
  99. .popupItemOne {
  100. font-size: 15px;
  101. color: #333;
  102. }
  103. .popupItemTwo {
  104. font-size: 13px;
  105. color: #999;
  106. margin-top: 10px;
  107. }
  108. .popupItemIcon {
  109. position: absolute;
  110. right: 7px;
  111. top: 50%;
  112. font-size: 20px;
  113. margin-top: -10px;
  114. color: #999;
  115. }
  116. .popupConBox {
  117. box-sizing: border-box;
  118. }
  119. .borderNone {
  120. border-radius: 0;
  121. }
  122. .marginNone {
  123. margin: 0 !important;
  124. }
  125. .popupBtn {
  126. padding: 0 15px;
  127. margin-top: 10px;
  128. margin-bottom: 15px;
  129. }
  130. .conBorder {
  131. width: auto !important;
  132. margin: 0 15px;
  133. border-radius: 10px;
  134. box-sizing: border-box;
  135. }
  136. .userNameClass_left {
  137. display: inline-block;
  138. width: 100px;
  139. }
  140. .userNameClass_right {
  141. display: inline-block;
  142. width: 150px;
  143. float: right;
  144. text-align: right;
  145. overflow: hidden;
  146. white-space:nowrap;
  147. text-overflow: ellipsis;
  148. }
  149. </style>