ListSecondaryHeading.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="index_main">
  3. <nav class="index_nav clearfix">
  4. <span class="index_nav_a_one" href="javascript:(void)">{{ name }}</span>
  5. <span v-for="(item,index) in nav" :class="['index_nav_a', { 'index_nav_a_only': targetSegment === item.aLIas_pinyin }]">
  6. <span v-if="index<=7">
  7. <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}">{{ item.alias }}</NuxtLink>
  8. </span>
  9. </span>
  10. </nav>
  11. </div>
  12. </template>
  13. <script setup>
  14. //1.设置组件数据 start---------------------------------------->
  15. //子导航
  16. const props = defineProps({
  17. name:String,
  18. nav:Array
  19. });
  20. //获取当前url路径
  21. const route = useRoute();
  22. //获得当前的完整路径
  23. const fullPath = route.path;
  24. const segments = fullPath.split('/');
  25. const targetRoute = segments[1];
  26. //1.设置组件数据 end---------------------------------------->
  27. </script>
  28. <style lang="less" scoped>
  29. .index_main {
  30. width: 1200px;
  31. margin: 0 auto;
  32. }
  33. .index_nav {
  34. width: 1200px;
  35. margin: 0 auto;
  36. margin-top: 20px;
  37. border-bottom: solid 1px #D9D9D9;
  38. height: 88px;
  39. .index_nav_a_one {
  40. float: left;
  41. color: #333;
  42. font-size: 16px;
  43. margin: 0px 30px;
  44. height: 88px;
  45. line-height: 88px;
  46. font-weight: bold;
  47. border-bottom: solid 3px #fff;
  48. box-sizing: border-box;
  49. position: relative;
  50. overflow: hidden;
  51. height: 56px;
  52. line-height: 56px;
  53. color: #fff;
  54. font-size: 18px;
  55. font-weight: bold;
  56. width: 153px;
  57. margin: 14px 30px 0px 0px;
  58. text-indent: 46px;
  59. background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
  60. background-size: 100% 100%;
  61. }
  62. .index_nav_a {
  63. float: left;
  64. color: #333;
  65. font-size: 16px;
  66. margin: 0px 30px;
  67. height: 88px;
  68. line-height: 88px;
  69. font-weight: bold;
  70. border-bottom: solid 3px #fff;
  71. box-sizing: border-box;
  72. position: relative;
  73. a {
  74. color:#333333
  75. }
  76. &:hover{
  77. border-bottom: solid 3px #D2600F;
  78. }
  79. }
  80. .index_nav_a a:hover{
  81. color: #D2600F;
  82. // border-bottom: solid 3px #D2600F;
  83. }
  84. .index_nav_a_only {
  85. border-bottom: solid 3px #D2600F;
  86. }
  87. .index_nav_a::after {
  88. content: '';
  89. display: block;
  90. position: absolute;
  91. width: 2px;
  92. height: 12px;
  93. background: #DBDBDB;
  94. right: -38px;
  95. top: 39px;
  96. }
  97. .index_nav_a:nth-last-of-type(1) {
  98. overflow: hidden;
  99. }
  100. a.index_nav_a:nth-of-type(1) {
  101. overflow: hidden;
  102. height: 56px;
  103. line-height: 56px;
  104. color: #fff;
  105. font-size: 18px;
  106. font-weight: bold;
  107. width: 153px;
  108. margin: 14px 30px 0px 0px;
  109. text-indent: 46px;
  110. background: url(https://img.bjzxtw.org.cn/master/www/nmw/img/3.png) no-repeat left top;
  111. background-size: 100% 100%;
  112. }
  113. }
  114. </style>