App.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div id="app">
  3. <div class="topNav">
  4. <div id="nav" role="navigation">
  5. <div id="home_tab" class="liubai">
  6. <img src="./assets/logo.png" alt />
  7. <div id="nav-a">
  8. <router-link to="/">首页</router-link>
  9. <router-link to="/serve">服务</router-link>
  10. <router-link to="/teach">人才培养</router-link>
  11. <router-link to="/news">新闻</router-link>
  12. <router-link to="/about">关于我们</router-link>
  13. </div>
  14. <img
  15. src=".\assets\menu.png"
  16. alt="切换目录"
  17. @click="aaa = !aaa"
  18. class="phonemenu"
  19. style="width:32px !important;height:18px !important;"
  20. />
  21. <div type="button" :class="{ showmenu: aaa, switching: true }" @click="aaa = !aaa">
  22. <ul>
  23. <li>
  24. <router-link to="/">
  25. 首页
  26. <span class="sr-only">切换导航</span>
  27. </router-link>
  28. </li>
  29. <li>
  30. <router-link to="/serve">
  31. 服务
  32. <span class="icon-bar"></span>
  33. </router-link>
  34. </li>
  35. <li>
  36. <router-link to="/teach">人才培养</router-link>
  37. </li>
  38. <li>
  39. <router-link to="/news">新闻</router-link>
  40. </li>
  41. <li>
  42. <router-link to="/about">关于我们</router-link>
  43. </li>
  44. </ul>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="fenge"></div>
  49. <router-view />
  50. </div>
  51. </div>
  52. </template>
  53. <style lang="stylus">
  54. @media only screen and (max-width: 479px) {
  55. .fenge {
  56. height: 40px !important;
  57. backgroundColor: blue;
  58. }
  59. #nav {
  60. height: 40px !important;
  61. }
  62. #nav img {
  63. width: 80px !important;
  64. height: 18px !important;
  65. margin: 10px 31px !important;
  66. margin-left: 0px !important;
  67. }
  68. #nav-a {
  69. height: 40px !important;
  70. line-height: 40px !important;
  71. margin-right: 31px !important;
  72. }
  73. #nav-a a {
  74. width: 38px !important;
  75. font-size: 12px;
  76. height: 40px !important;
  77. overflow: hidden;
  78. &.router-link-exact-active {
  79. width: 38px !important;
  80. }
  81. }
  82. }
  83. @media screen and (max-width: 479px) {
  84. html {
  85. font-size: 3px !important;
  86. }
  87. }
  88. @media only screen and (min-width: 479px) {
  89. #nav {
  90. width: 100% !important;
  91. }
  92. }
  93. @media only screen and (max-width: 1440px) {
  94. #nav {
  95. width: 100% !important;
  96. }
  97. .liubai {
  98. width: 83.3% !important;
  99. margin: auto 8.3% !important;
  100. }
  101. }
  102. @media only screen and (max-width: 661px) {
  103. #nav-a {
  104. display: none !important;
  105. }
  106. .phonemenu {
  107. display: block !important;
  108. }
  109. }
  110. @media only screen and (min-width: 661px) {
  111. .switching, .showmenu {
  112. display: none;
  113. }
  114. }
  115. .fenge {
  116. height: 80px;
  117. backgroundColor: blue;
  118. }
  119. .phonemenu {
  120. display: none;
  121. position: absolute;
  122. right: 0px;
  123. z-index: 999;
  124. }
  125. .showmenu {
  126. display: none;
  127. }
  128. .switching {
  129. position: absolute;
  130. right: 19px;
  131. top: 0px;
  132. background-image: linear-gradient(-90deg, #f5fffd 0%, #1b1b1d00 100%);
  133. border-radius: 2%;
  134. padding-top: 40px;
  135. }
  136. .switching li {
  137. padding-bottom: 6px !important;
  138. }
  139. .liubai {
  140. width: 1200px;
  141. margin: 0 auto;
  142. }
  143. #app {
  144. font-family: 'Avenir', Helvetica, Arial, sans-serif;
  145. -webkit-font-smoothing: antialiased;
  146. -moz-osx-font-smoothing: grayscale;
  147. text-align: center;
  148. color: #2c3e50;
  149. }
  150. #nav {
  151. padding: 0px;
  152. background: #FFFFFF;
  153. position: fixed;
  154. top: 0px;
  155. z-index: 999;
  156. }
  157. #home_tab {
  158. display: flex;
  159. justify-content: space-between;
  160. }
  161. #nav-a {
  162. height: 80px;
  163. line-height: 80px;
  164. display: flex;
  165. a {
  166. font-family: PingFangSC-Regular;
  167. font-size: 18px;
  168. color: #4A4A4A;
  169. letter-spacing: 0;
  170. text-decoration: none;
  171. width: 100px;
  172. height: 80px;
  173. text-align: center;
  174. &.router-link-exact-active {
  175. color: #FFFFFF;
  176. width: 100px;
  177. height: 80px;
  178. text-align: center;
  179. background-image: linear-gradient(-90deg, #30D5FF 0%, #749CF7 100%);
  180. }
  181. }
  182. }
  183. #nav img {
  184. width: 161px;
  185. height: 36px;
  186. margin-top: 15px;
  187. margin-bottom: 29px;
  188. }
  189. </style>
  190. <script>
  191. /* eslint-disable */
  192. export default {
  193. name: "app",
  194. data() {
  195. return {
  196. aaa: true,
  197. screenWidth: document.body.clientWidth
  198. };
  199. },
  200. mounted() {
  201. const that = this;
  202. window.onresize = () => {
  203. return (() => {
  204. window.screenWidth = document.body.clientWidth;
  205. that.screenWidth = window.screenWidth;
  206. document.getElementsByTagName("html")[0].style.fontSize=screenWidth/200+'px';
  207. })();
  208. };
  209. },
  210. };
  211. </script>