ListSecondaryHeading.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <main class="index">
  3. <nav class="channel_nav clearfix">
  4. <NuxtLink class="channel_nav_a_head" :href="`/${pinyin}/index.html`" :title="name">{{ name }}</NuxtLink>
  5. <div class="channel_nav_right clearfix">
  6. <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}" class="channel_nav_a"
  7. v-for="(item, index) in nav" :key="index">
  8. {{ item.alias }}
  9. </NuxtLink>
  10. </div>
  11. </nav>
  12. </main>
  13. </template>
  14. <script setup>
  15. //1.设置组件数据 start---------------------------------------->
  16. //子导航
  17. const props = defineProps({
  18. name:String,
  19. nav:Array,
  20. pinyin:String,
  21. });
  22. //获取当前url路径
  23. const route = useRoute();
  24. //获得当前的完整路径
  25. const fullPath = route.path;
  26. const segments = fullPath.split('/');
  27. const targetRoute = segments[1];
  28. //1.设置组件数据 end---------------------------------------->
  29. </script>
  30. <style lang="less" scoped>
  31. .index{
  32. width: 1200px;
  33. margin: 0 auto;
  34. }
  35. .channel_nav {
  36. background: #A91B33;
  37. margin: 20px auto 0px;
  38. position: relative;
  39. z-index: 11;
  40. display: flex;
  41. .channel_nav_a_head {
  42. word-break: keep-all;
  43. white-space: nowrap;
  44. display: block;
  45. background: #fff;
  46. border-top-left-radius: 7px;
  47. border-top-right-radius: 7px;
  48. position: relative;
  49. z-index: 22;
  50. font-size: 16px;
  51. font-weight: bold;
  52. height: 51px;
  53. line-height: 42px;
  54. color: #A91B33;
  55. margin: auto 21px 0px 35px;
  56. padding: 0px 40px;
  57. }
  58. .channel_nav_a_head::before {
  59. content: '';
  60. display: block;
  61. position: absolute;
  62. width: 64px;
  63. height: 2px;
  64. background: #A91B33;
  65. left: 50%;
  66. margin-left: -32px;
  67. bottom: 10px;
  68. }
  69. .channel_nav_right {
  70. flex: 1;
  71. padding: 10px 0px;
  72. }
  73. .channel_nav_a {
  74. float: left;
  75. height: 22px;
  76. line-height: 22px;
  77. position: relative;
  78. color: #fff;
  79. font-size: 16px;
  80. font-weight: bold;
  81. margin: 5px 13.5px;
  82. text-align: center;
  83. width: 96px;
  84. }
  85. .channel_nav_a::after {
  86. content: '';
  87. display: block;
  88. position: absolute;
  89. width: 1px;
  90. height: 14px;
  91. background: #BF3519;
  92. left: -14px;
  93. top: 5px;
  94. }
  95. }
  96. </style>