ListSecondaryHeading.vue 4.5 KB

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