App.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div class="h100">
  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. * {
  44. font-family: '微软雅黑';
  45. }
  46. .h100 {
  47. height: 100vh;
  48. box-sizing: border-box;
  49. }
  50. /* flex */
  51. .flexCoum {
  52. display: flex;
  53. flex-wrap: wrap;
  54. flex-direction: column;
  55. height: 100%;
  56. }
  57. /* 超出隐藏 */
  58. .textBeyondHiding {
  59. overflow: hidden;
  60. text-overflow: ellipsis;
  61. white-space: nowrap;
  62. }
  63. .flexCoum-box {
  64. flex: 1;
  65. overflow: auto;
  66. }
  67. /* 去除滚动条 */
  68. .contentRoll::-webkit-scrollbar { width: 0 !important }
  69. .contentRoll { -ms-overflow-style: none; }
  70. .contentRoll { overflow: -moz-scrollbars-none; }
  71. .popupDiv {
  72. background: #F4F4F4;
  73. position: relative;
  74. height: 100%;
  75. width: 100%;
  76. display: flex;
  77. flex-direction: column;
  78. }
  79. .popupSearch {
  80. width: 100%;
  81. }
  82. .popupCon {
  83. width: 100%;
  84. overflow: auto;
  85. position: relative;
  86. }
  87. .paddingDiv {
  88. box-sizing: border-box;
  89. margin: 0 15px;
  90. }
  91. .popupTitle {
  92. color: #333333;
  93. padding: 0 30px;
  94. position: relative;
  95. line-height: 20px;
  96. }
  97. .popupTitle::after {
  98. content: '';
  99. width: 3px;
  100. height: 100%;
  101. border-radius: 3px;
  102. background: #409eff;
  103. position: absolute;
  104. top: 0;
  105. left: 15px;
  106. }
  107. .popupItem {
  108. background: #FFFFFF;
  109. padding: 10px 10px;
  110. border-radius: 6px;
  111. margin-top: 14px;
  112. position: relative;
  113. }
  114. .marginTop {
  115. margin-top: 15px;
  116. }
  117. .paddingTop {
  118. padding-top: 10px;
  119. }
  120. .popupItem p {
  121. width: 100%;
  122. overflow: hidden;
  123. white-space:nowrap;
  124. text-overflow: ellipsis;
  125. line-height: 22px;
  126. }
  127. .popupItemOne {
  128. font-size: 15px;
  129. color: #333;
  130. }
  131. .popupItemTwo {
  132. font-size: 13px;
  133. color: #999;
  134. margin-top: 10px;
  135. }
  136. .popupItemIcon {
  137. position: absolute;
  138. right: 7px;
  139. top: 50%;
  140. font-size: 20px;
  141. margin-top: -10px;
  142. color: #999;
  143. }
  144. .popupConBox {
  145. box-sizing: border-box;
  146. }
  147. .borderNone {
  148. border-radius: 0;
  149. }
  150. .marginNone {
  151. margin: 0 !important;
  152. }
  153. .popupBtn {
  154. padding: 0 15px;
  155. margin-top: 10px;
  156. margin-bottom: 15px;
  157. }
  158. .conBorder {
  159. width: auto !important;
  160. margin: 0 15px;
  161. border-radius: 10px;
  162. box-sizing: border-box;
  163. }
  164. .userNameClass_left {
  165. display: inline-block;
  166. width: 100px;
  167. }
  168. .userNameClass_right {
  169. display: inline-block;
  170. width: 150px;
  171. float: right;
  172. text-align: right;
  173. overflow: hidden;
  174. white-space:nowrap;
  175. text-overflow: ellipsis;
  176. }
  177. </style>