ListSecondaryHeading.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="index_main">
  3. <nav class="index_nav clearfix ">
  4. <div class="index_navTitle_box">
  5. <NuxtLink :to="`/${pinyin}/index.html`">
  6. <span class="index_nav_a_one" title="">
  7. {{ name }}
  8. </span>
  9. </NuxtLink>
  10. </div>
  11. <div class="index_nav_box">
  12. <span v-for="(item, index) in nav"
  13. :class="['index_nav_a', { 'index_nav_a_only': targetSegment === item.aLIas_pinyin }]">
  14. <span v-if="index <= 20">
  15. <NuxtLink :to="{ path: `/${item.aLIas_pinyin}/list-1.html` }">{{ item.alias }}</NuxtLink>
  16. </span>
  17. </span>
  18. </div>
  19. </nav>
  20. <div class="phone_nav pc_none">
  21. <div class="phone_nav_in">
  22. <NuxtLink
  23. v-for="(item, index) in nav" :key="index"
  24. :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}"
  25. :title="item.alias"
  26. class="phone_nav_a"
  27. >
  28. {{ item.alias }}
  29. </NuxtLink>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script setup>
  35. //1.设置组件数据 start---------------------------------------->
  36. //子导航
  37. const props = defineProps({
  38. name: String,
  39. nav: Array,
  40. pinyin: String,
  41. });
  42. //获取当前url路径
  43. const route = useRoute();
  44. //获得当前的完整路径
  45. const fullPath = route.path;
  46. const segments = fullPath.split('/');
  47. const targetRoute = segments[1];
  48. //1.设置组件数据 end---------------------------------------->
  49. </script>
  50. <style lang="less" scoped>
  51. .index_main {
  52. width: 1200px;
  53. margin: 0 auto;
  54. margin-bottom: 10px;
  55. }
  56. .index_nav {
  57. width: 1200px;
  58. margin: 0 auto;
  59. margin-top: 20px;
  60. border-bottom: solid 1px #D9D9D9;
  61. height: 88px;
  62. .index_navTitle_box {
  63. float: left;
  64. height: 88px;
  65. line-height: 88px;
  66. font-size: 16px;
  67. font-weight: bold;
  68. color: #333;
  69. width: 153px;
  70. // margin: 0px 30px;
  71. }
  72. .index_nav_a_one {
  73. float: left;
  74. color: #333;
  75. font-size: 16px;
  76. margin: 0px 30px;
  77. height: 88px;
  78. line-height: 88px;
  79. font-weight: bold;
  80. border-bottom: solid 3px #fff;
  81. box-sizing: border-box;
  82. position: relative;
  83. overflow: hidden;
  84. height: 56px;
  85. line-height: 56px;
  86. color: #fff;
  87. font-size: 18px;
  88. font-weight: bold;
  89. width: 153px;
  90. margin: 14px 30px 0px 0px;
  91. text-indent: 46px;
  92. background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
  93. background-size: 100% 100%;
  94. }
  95. .index_nav_box {
  96. float: left;
  97. // height: 88px;
  98. // line-height: 88px;
  99. font-size: 16px;
  100. font-weight: bold;
  101. color: #333;
  102. width: 1009px;
  103. margin-top: 15px;
  104. margin-left: 25px;
  105. }
  106. .index_nav_a {
  107. float: left;
  108. color: #333;
  109. font-size: 16px;
  110. margin: 5px 30px;
  111. font-weight: bold;
  112. border-bottom: solid 3px #fff;
  113. box-sizing: border-box;
  114. position: relative;
  115. a {
  116. color: #333333
  117. }
  118. &:hover {
  119. border-bottom: solid 3px #D2600F;
  120. }
  121. }
  122. .index_nav_a a:hover {
  123. color: #D2600F;
  124. // border-bottom: solid 3px #D2600F;
  125. }
  126. .index_nav_a_only {
  127. border-bottom: solid 3px #D2600F;
  128. }
  129. .index_nav_a::after {
  130. content: '';
  131. display: block;
  132. position: absolute;
  133. width: 2px;
  134. height: 12px;
  135. background: #DBDBDB;
  136. right: -28px;
  137. top: 6px;
  138. }
  139. // .index_nav_a:nth-last-of-type(1) {
  140. // overflow: hidden;
  141. // }
  142. // a.index_nav_a:nth-of-type(1) {
  143. // overflow: hidden;
  144. // height: 56px;
  145. // line-height: 56px;
  146. // color: #fff;
  147. // font-size: 18px;
  148. // font-weight: bold;
  149. // width: 153px;
  150. // margin: 14px 30px 0px 0px;
  151. // text-indent: 46px;
  152. // background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
  153. // background-size: 100% 100%;
  154. // }
  155. }
  156. </style>
  157. <style lang="less" scoped>
  158. @media screen and (min-width:801px){/*pc*/
  159. .pc_none{display:none;}
  160. }
  161. @media screen and (max-width:800px){/*ipad_phone*/
  162. .index_main{width:100%;}
  163. .index_nav{width:100%;display:none;}
  164. .phone_nav{
  165. width:100%; box-sizing:border-box;background:#fafafa;
  166. margin:20px auto 11px;height:33px;
  167. .phone_nav_in{ width:92%;margin:0px auto;
  168. overflow-x:auto;overflow-y:hidden;
  169. word-break: keep-all; white-space: nowrap;
  170. line-height:33px;
  171. height:33px;
  172. }
  173. .phone_nav_in::-webkit-scrollbar{height:0px;}
  174. .phone_nav_a{display:inline-block;line-height:33px;height:33px;
  175. color:#333;font-size:14px;margin:0px 10px;
  176. }
  177. .phone_nav_a:nth-of-type(1){margin-left:0px; }
  178. }
  179. .phone_nav_in .router-link-exact-active{
  180. color:#dd7d18;
  181. }
  182. .phone_none{display:none;}
  183. }
  184. </style>