ListSecondaryHeading.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <main class="index">
  3. <nav class="channel_nav clearfix phone_none">
  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. <div class="phone_nav pc_none">
  13. <div class="phone_nav_in">
  14. <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}"
  15. class="phone_nav_a"
  16. v-for="(item, index) in nav" :key="index">
  17. {{ item.alias }}
  18. </NuxtLink>
  19. </div>
  20. </div>
  21. </main>
  22. </template>
  23. <script setup>
  24. //1.设置组件数据 start---------------------------------------->
  25. //子导航
  26. const props = defineProps({
  27. name:String,
  28. nav:Array,
  29. pinyin:String,
  30. });
  31. //获取当前url路径
  32. const route = useRoute();
  33. //获得当前的完整路径
  34. const fullPath = route.path;
  35. const segments = fullPath.split('/');
  36. const targetRoute = segments[1];
  37. //1.设置组件数据 end---------------------------------------->
  38. </script>
  39. <style lang="less" scoped>
  40. .index{
  41. width: 1200px;
  42. margin: 0 auto;
  43. }
  44. .channel_nav {
  45. background: #A91B33;
  46. margin: 20px auto 0px;
  47. position: relative;
  48. z-index: 11;
  49. display: flex;
  50. .channel_nav_a_head {
  51. word-break: keep-all;
  52. white-space: nowrap;
  53. display: block;
  54. background: #fff;
  55. border-top-left-radius: 7px;
  56. border-top-right-radius: 7px;
  57. position: relative;
  58. z-index: 22;
  59. font-size: 16px;
  60. font-weight: bold;
  61. height: 51px;
  62. line-height: 42px;
  63. color: #A91B33;
  64. margin: auto 21px 0px 35px;
  65. padding: 0px 40px;
  66. }
  67. .channel_nav_a_head::before {
  68. content: '';
  69. display: block;
  70. position: absolute;
  71. width: 64px;
  72. height: 2px;
  73. background: #A91B33;
  74. left: 50%;
  75. margin-left: -32px;
  76. bottom: 10px;
  77. }
  78. .channel_nav_right {
  79. flex: 1;
  80. padding: 10px 0px;
  81. }
  82. .channel_nav_a {
  83. float: left;
  84. height: 22px;
  85. line-height: 22px;
  86. position: relative;
  87. color: #fff;
  88. font-size: 16px;
  89. font-weight: bold;
  90. margin: 5px 13.5px;
  91. text-align: center;
  92. width: 96px;
  93. }
  94. .channel_nav_a::after {
  95. content: '';
  96. display: block;
  97. position: absolute;
  98. width: 1px;
  99. height: 14px;
  100. background: #BF3519;
  101. left: -14px;
  102. top: 5px;
  103. }
  104. }
  105. </style>
  106. <style lang="less" scoped>
  107. @media screen and (min-width:801px){/*pc*/
  108. .pc_none{display:none;}
  109. }
  110. @media screen and (max-width:800px){/*ipad_phone*/
  111. .index{width:100%;}
  112. .index_main{width:100%;}
  113. .index_nav{width:100%;}
  114. .phone_nav{
  115. width:100%; box-sizing:border-box;background:#fafafa;
  116. margin:10px auto;height:33px;
  117. .phone_nav_in{ width:92%;margin:0px auto;
  118. overflow-x:auto;overflow-y:hidden;
  119. word-break: keep-all; white-space: nowrap;
  120. line-height:33px;
  121. height:33px;
  122. }
  123. .phone_nav_in::-webkit-scrollbar{height:0px;}
  124. .phone_nav_a{display:inline-block;line-height:33px;height:33px;
  125. color:#333;font-size:14px;margin:0px 10px;
  126. }
  127. .phone_nav_a:nth-of-type(1){margin-left:0px; }
  128. .phone_nav_in .router-link-exact-active.phone_nav_a{
  129. color:#a91b33;
  130. }
  131. }
  132. .phone_none{display:none;}
  133. }
  134. </style>