ListSecondaryHeading.vue 2.3 KB

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