ListSecondaryHeading.vue 1.6 KB

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