ListSecondaryHeading_sec.vue 5.4 KB

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