1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <nav class="channel_nav back100">
- <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 {
- height: 60px;
- width: 1200px;
- margin: 0 auto;
- background-image: url(@/public/img/5.png);
- margin-top: 40px;
- .channel_nav_a {
- float: left;
- height: 60px;
- line-height: 60px;
- color: #255590;
- font-size: 20px;
- margin: 0px 19px;
- font-weight: bold;
- }
- >.channel_nav_a:nth-of-type(1) {
- color: #fff;
- width: 230px;
- padding-left: 50px;
- box-sizing: border-box;
- margin-left:0;
- margin-right: 0;
- }
- }
- .back100 {
- background-size: 100% 100%;
- background-repeat: no-repeat;
- }
- </style>
|