ListSecondaryHeading.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <nav class="channel_nav back100">
  3. <a class="channel_nav_a" href="javascript:(void)" title="name">{{ name }}</a>
  4. <span v-for="(item,index) in nav">
  5. <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}" class="channel_nav_a" v-if="index<=7">{{ item.alias }}</NuxtLink>
  6. </span>
  7. </nav>
  8. </template>
  9. <script setup>
  10. //1.设置组件数据 start---------------------------------------->
  11. //子导航
  12. const props = defineProps({
  13. name:String,
  14. nav:Array
  15. });
  16. //获取当前url路径
  17. const route = useRoute();
  18. //获得当前的完整路径
  19. const fullPath = route.path;
  20. const segments = fullPath.split('/');
  21. const targetRoute = segments[1];
  22. //1.设置组件数据 end---------------------------------------->
  23. </script>
  24. <style lang="less" scoped>
  25. .channel_nav {
  26. height: 60px;
  27. width: 1200px;
  28. margin: 0 auto;
  29. background-image: url(@/public/img/5.png);
  30. margin-top: 40px;
  31. .channel_nav_a {
  32. float: left;
  33. height: 60px;
  34. line-height: 60px;
  35. color: #255590;
  36. font-size: 20px;
  37. margin: 0px 19px;
  38. font-weight: bold;
  39. }
  40. >.channel_nav_a:nth-of-type(1) {
  41. color: #fff;
  42. width: 230px;
  43. padding-left: 50px;
  44. box-sizing: border-box;
  45. margin-left:0;
  46. margin-right: 0;
  47. }
  48. }
  49. .back100 {
  50. background-size: 100% 100%;
  51. background-repeat: no-repeat;
  52. }
  53. </style>