12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <template>
- <nav class="channel_nav clearfix">
- <a class="channel_nav_a" href="javascript:(void)" title="name">{{ name }}</a>
- <span v-for="(item,index) in nav">
- <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}" class="channel_nav_a" v-if="index<=7">{{ item.alias }}</NuxtLink>
- </span>
- </nav>
- </template>
- <script setup>
- //1.设置组件数据 start---------------------------------------->
- //子导航
- const props = defineProps({
- name:String,
- nav:Array
- });
- //获取当前url路径
- const route = useRoute();
- //获得当前的完整路径
- const fullPath = route.path;
- const segments = fullPath.split('/');
- const targetRoute = segments[1];
- //1.设置组件数据 end---------------------------------------->
- </script>
- <style lang="less" scoped>
- .channel_nav {
- background: #A91B33;
- margin: 40px auto 0px;
- position: relative;
- z-index: 11;
- height: 61px;
- width:1200px;
- margin: 0 auto;
- .channel_nav_a {
- float: left;
- height: 22px;
- line-height: 22px;
- position: relative;
- color: #fff;
- font-size: 16px;
- font-weight: bold;
- margin: 20px 29.4px;
- text-align: center;
- }
- .channel_nav_a::after {
- content: '';
- display: block;
- position: absolute;
- width: 1px;
- height: 14px;
- background: #BF3519;
- left: -28px;
- top: 4px;
- }
- .channel_nav_a:nth-of-type(2)::after {
- display: none;
- }
- >.channel_nav_a:nth-of-type(1) {
- background: #fff;
- border-top-left-radius: 7px;
- border-top-right-radius: 7px;
- position: relative;
- z-index: 22;
- height: 51px;
- line-height: 42px;
- color: #A91B33;
- margin: 10px 21px 0px 35px;
- padding: 0px 40px;
- }
- >.channel_nav_a:nth-of-type(1)::after {
- display: none;
- }
- >.channel_nav_a:nth-of-type(1)::before {
- content: '';
- display: block;
- position: absolute;
- width: 64px;
- height: 2px;
- background: #A91B33;
- left: 50%;
- margin-left: -32px;
- bottom: 10px;
- }
- >.channel_nav_a:nth-last-of-type(1) {
- margin-right: 0px;
- }
- }
- </style>
|