ListSecondaryHeading.vue 2.3 KB

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