ListSecondaryHeading.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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>
  21. </template>
  22. <script setup>
  23. //1.设置组件数据 start---------------------------------------->
  24. //子导航
  25. const props = defineProps({
  26. name: String,
  27. nav: Array,
  28. pinyin: String,
  29. });
  30. //获取当前url路径
  31. const route = useRoute();
  32. //获得当前的完整路径
  33. const fullPath = route.path;
  34. const segments = fullPath.split('/');
  35. const targetRoute = segments[1];
  36. //1.设置组件数据 end---------------------------------------->
  37. </script>
  38. <style lang="less" scoped>
  39. .index_main {
  40. width: 1200px;
  41. margin: 0 auto;
  42. margin-bottom: 10px;
  43. }
  44. .index_nav {
  45. width: 1200px;
  46. margin: 0 auto;
  47. margin-top: 20px;
  48. border-bottom: solid 1px #D9D9D9;
  49. height: 88px;
  50. .index_navTitle_box {
  51. float: left;
  52. height: 88px;
  53. line-height: 88px;
  54. font-size: 16px;
  55. font-weight: bold;
  56. color: #333;
  57. width: 153px;
  58. // margin: 0px 30px;
  59. }
  60. .index_nav_a_one {
  61. float: left;
  62. color: #333;
  63. font-size: 16px;
  64. margin: 0px 30px;
  65. height: 88px;
  66. line-height: 88px;
  67. font-weight: bold;
  68. border-bottom: solid 3px #fff;
  69. box-sizing: border-box;
  70. position: relative;
  71. overflow: hidden;
  72. height: 56px;
  73. line-height: 56px;
  74. color: #fff;
  75. font-size: 18px;
  76. font-weight: bold;
  77. width: 153px;
  78. margin: 14px 30px 0px 0px;
  79. text-indent: 46px;
  80. background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
  81. background-size: 100% 100%;
  82. }
  83. .index_nav_box {
  84. float: left;
  85. // height: 88px;
  86. // line-height: 88px;
  87. font-size: 16px;
  88. font-weight: bold;
  89. color: #333;
  90. width: 1009px;
  91. margin-top: 15px;
  92. margin-left: 25px;
  93. }
  94. .index_nav_a {
  95. float: left;
  96. color: #333;
  97. font-size: 16px;
  98. margin: 5px 30px;
  99. font-weight: bold;
  100. border-bottom: solid 3px #fff;
  101. box-sizing: border-box;
  102. position: relative;
  103. a {
  104. color: #333333
  105. }
  106. &:hover {
  107. border-bottom: solid 3px #D2600F;
  108. }
  109. }
  110. .index_nav_a a:hover {
  111. color: #D2600F;
  112. // border-bottom: solid 3px #D2600F;
  113. }
  114. .index_nav_a_only {
  115. border-bottom: solid 3px #D2600F;
  116. }
  117. .index_nav_a::after {
  118. content: '';
  119. display: block;
  120. position: absolute;
  121. width: 2px;
  122. height: 12px;
  123. background: #DBDBDB;
  124. right: -28px;
  125. top: 6px;
  126. }
  127. // .index_nav_a:nth-last-of-type(1) {
  128. // overflow: hidden;
  129. // }
  130. // a.index_nav_a:nth-of-type(1) {
  131. // overflow: hidden;
  132. // height: 56px;
  133. // line-height: 56px;
  134. // color: #fff;
  135. // font-size: 18px;
  136. // font-weight: bold;
  137. // width: 153px;
  138. // margin: 14px 30px 0px 0px;
  139. // text-indent: 46px;
  140. // background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
  141. // background-size: 100% 100%;
  142. // }
  143. }
  144. </style>