ListSecondaryHeading.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <nav class="channel_nav">
  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. </template>
  10. <script setup>
  11. //1.设置组件数据 start---------------------------------------->
  12. //子导航
  13. const props = defineProps({
  14. name: String,
  15. nav: Array,
  16. pinyin: String,
  17. });
  18. //获取当前url路径
  19. const route = useRoute();
  20. //获得当前的完整路径
  21. const fullPath = route.path;
  22. const segments = fullPath.split('/');
  23. const targetRoute = segments[1];
  24. //1.设置组件数据 end---------------------------------------->
  25. </script>
  26. <style lang="less" scoped>
  27. .channel_nav {
  28. width: 1200px;
  29. margin: 0 auto;
  30. border-bottom: solid 3px #004564;
  31. margin-top: 20px;
  32. display: flex;
  33. overflow: hidden;
  34. .channel_nav_head_name {
  35. margin: auto 2px 0px 0px;
  36. height: 44px;
  37. line-height: 44px;
  38. font-size: 30px;
  39. color: #fff;
  40. font-weight: bold;
  41. background: url(@/public/img/27.png) no-repeat right 0px;
  42. background-size: 100% 102%;
  43. padding: 0px 33px;
  44. box-sizing: border-box;
  45. }
  46. .channel_nav_a_box {
  47. flex: 1;
  48. margin-top: auto;
  49. overflow: hidden;
  50. }
  51. .channel_nav_a {
  52. float: left;
  53. height: 24px;
  54. line-height: 24px;
  55. color: #333;
  56. font-size: 18px;
  57. margin: 3px 10px 7px;
  58. font-weight: bold;
  59. // width: 88px;
  60. box-sizing: border-box;
  61. text-align: center;
  62. }
  63. .channel_nav_a:nth-of-type(10n) {
  64. margin-right: 0px;
  65. }
  66. }
  67. .back100 {
  68. background-size: 100% 100%;
  69. background-repeat: no-repeat;
  70. }
  71. </style>