ListSecondaryHeading.vue 1.9 KB

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