ListSecondaryHeading.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <nav class="channel_nav_box">
  3. <a class="channel_nav_head" href="javascript:(void)" title="name">{{ name }}</a>
  4. <div class="channel_nav_a_box clearfix">
  5. <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}" class="channel_nav_a" v-for="item in nav">{{ item.alias }}</NuxtLink>
  6. </div>
  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_box {
  26. display:flex;
  27. width: 1200px;
  28. margin: 0 auto;
  29. background: url(http://img.bjzxtw.org.cn/master/www/snscw/5.png) no-repeat bottom;
  30. background-size:100% auto;
  31. margin-top: 40px;
  32. .channel_nav_head {
  33. height: 60px;
  34. line-height: 60px;
  35. color: #fff;
  36. margin: 0px 70px 0px 31px;
  37. box-sizing:border-box;
  38. margin-top:auto;
  39. font-size:20px;
  40. font-weight:bold;
  41. }
  42. .channel_nav_a_box{
  43. flex:1;
  44. padding:12px 0px;
  45. }
  46. .channel_nav_a {
  47. float: left;
  48. height: 26px;
  49. line-height: 26px;
  50. color: #255590;
  51. font-size: 20px;
  52. margin: 5px 19px;
  53. font-weight: bold;
  54. }
  55. }
  56. </style>