ListSecondaryHeading.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. console.log(999)
  27. console.log(targetRoute)
  28. //1.设置组件数据 end---------------------------------------->
  29. </script>
  30. <style lang="less" scoped>
  31. .index_main {
  32. width: 1200px;
  33. margin: 0 auto;
  34. }
  35. .index_nav {
  36. width: 1200px;
  37. margin: 0 auto;
  38. margin-top: 20px;
  39. border-bottom: solid 1px #D9D9D9;
  40. height: 88px;
  41. .index_nav_a_one {
  42. float: left;
  43. color: #333;
  44. font-size: 16px;
  45. margin: 0px 30px;
  46. height: 88px;
  47. line-height: 88px;
  48. font-weight: bold;
  49. border-bottom: solid 3px #fff;
  50. box-sizing: border-box;
  51. position: relative;
  52. overflow: hidden;
  53. height: 56px;
  54. line-height: 56px;
  55. color: #fff;
  56. font-size: 18px;
  57. font-weight: bold;
  58. width: 153px;
  59. margin: 14px 30px 0px 0px;
  60. text-indent: 46px;
  61. background: url(@/public/img/3.png) no-repeat left top;
  62. background-size: 100% 100%;
  63. }
  64. .index_nav_a {
  65. float: left;
  66. color: #333;
  67. font-size: 16px;
  68. margin: 0px 30px;
  69. height: 88px;
  70. line-height: 88px;
  71. font-weight: bold;
  72. border-bottom: solid 3px #fff;
  73. box-sizing: border-box;
  74. position: relative;
  75. a {
  76. color:#333333
  77. }
  78. &:hover{
  79. border-bottom: solid 3px #D2600F;
  80. }
  81. }
  82. .index_nav_a a:hover{
  83. color: #D2600F;
  84. // border-bottom: solid 3px #D2600F;
  85. }
  86. .index_nav_a_only {
  87. border-bottom: solid 3px #D2600F;
  88. }
  89. .index_nav_a::after {
  90. content: '';
  91. display: block;
  92. position: absolute;
  93. width: 2px;
  94. height: 12px;
  95. background: #DBDBDB;
  96. right: -38px;
  97. top: 39px;
  98. }
  99. .index_nav_a:nth-last-of-type(1) {
  100. overflow: hidden;
  101. }
  102. a.index_nav_a:nth-of-type(1) {
  103. overflow: hidden;
  104. height: 56px;
  105. line-height: 56px;
  106. color: #fff;
  107. font-size: 18px;
  108. font-weight: bold;
  109. width: 153px;
  110. margin: 14px 30px 0px 0px;
  111. text-indent: 46px;
  112. background: url(@/public/img/3.png) no-repeat left top;
  113. background-size: 100% 100%;
  114. }
  115. }
  116. </style>