App.vue 4.5 KB

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