ListSecondaryHeading.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <nav class="channel_nav phone_none">
  3. <a class="channel_nav_head_name" :href="`/${pinyin}/index.html`" title="name">{{ name }}</a>
  4. <div class="channel_nav_a_box">
  5. <NuxtLink v-for="(item, index) in nav" :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html` }"
  6. class="channel_nav_a" > {{ item.alias }}</NuxtLink>
  7. </div>
  8. </nav>
  9. <div class="phone_nav pc_none">
  10. <div class="phone_nav_in">
  11. <NuxtLink
  12. v-for="(item, index) in nav"
  13. :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html` }"
  14. class="phone_nav_a" >
  15. {{ item.alias }}
  16. </NuxtLink>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup>
  21. //1.设置组件数据 start---------------------------------------->
  22. //子导航
  23. const props = defineProps({
  24. name: String,
  25. nav: Array,
  26. pinyin: String,
  27. });
  28. //获取当前url路径
  29. const route = useRoute();
  30. //获得当前的完整路径
  31. const fullPath = route.path;
  32. const segments = fullPath.split('/');
  33. const targetRoute = segments[1];
  34. //1.设置组件数据 end---------------------------------------->
  35. </script>
  36. <style lang="less" scoped>
  37. .channel_nav {
  38. width: 1200px;
  39. margin: 0 auto;
  40. border-bottom: solid 3px #004564;
  41. margin-top: 20px;
  42. display: flex;
  43. overflow: hidden;
  44. .channel_nav_head_name {
  45. margin: auto 2px 0px 0px;
  46. height: 44px;
  47. line-height: 44px;
  48. font-size: 30px;
  49. color: #fff;
  50. font-weight: bold;
  51. background: url(@/public/img/27.png) no-repeat right 0px;
  52. background-size: 100% 102%;
  53. padding: 0px 33px;
  54. box-sizing: border-box;
  55. }
  56. .channel_nav_a_box {
  57. flex: 1;
  58. margin-top: auto;
  59. overflow: hidden;
  60. }
  61. .channel_nav_a {
  62. float: left;
  63. height: 24px;
  64. line-height: 24px;
  65. color: #333;
  66. font-size: 18px;
  67. margin: 3px 10px 7px;
  68. font-weight: bold;
  69. // width: 88px;
  70. box-sizing: border-box;
  71. text-align: center;
  72. }
  73. .channel_nav_a:nth-of-type(10n) {
  74. margin-right: 0px;
  75. }
  76. }
  77. .back100 {
  78. background-size: 100% 100%;
  79. background-repeat: no-repeat;
  80. }
  81. </style>
  82. <style lang="less" scoped>
  83. @media screen and (min-width:801px){/*pc*/
  84. .pc_none{display:none;}
  85. }
  86. @media screen and (max-width:800px){/*ipad_phone*/
  87. .index_nav{width:100%;}
  88. .phone_nav{
  89. width:100%; box-sizing:border-box;background:#fafafa;
  90. margin:10px auto;height:33px;
  91. .phone_nav_in{ width:92%;margin:0px auto;
  92. overflow-x:auto;overflow-y:hidden;
  93. word-break: keep-all; white-space: nowrap;
  94. line-height:33px;
  95. height:33px;
  96. }
  97. .phone_nav_in::-webkit-scrollbar{height:0px;}
  98. .phone_nav_a{display:inline-block;line-height:33px;height:33px;
  99. color:#333;font-size:14px;margin:0px 10px;
  100. }
  101. .phone_nav_a:nth-of-type(1){margin-left:0px; }
  102. .phone_nav_in .router-link-exact-active.phone_nav_a{
  103. color:#004564;
  104. }
  105. }
  106. .phone_none{display:none;}
  107. }
  108. </style>