<template>
    <nav class="channel_nav">
        <a class="channel_nav_head_name" :href="`/${pinyin}/index.html`" title="name">{{ name }}</a>
        <div class="channel_nav_a_box">
            <NuxtLink v-for="(item, index) in nav" :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html` }"
                class="channel_nav_a" >{{ item.alias }}</NuxtLink>
        </div>
    </nav>
</template>

<script setup>
//1.设置组件数据 start---------------------------------------->
//子导航
const props = defineProps({
    name: String,
    nav: Array,
    pinyin: String,
});

//获取当前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 {
    width: 1200px;
    margin: 0 auto;
    border-bottom: solid 3px #004564;
    margin-top: 20px;
    display: flex;
    overflow: hidden;

    .channel_nav_head_name {
        margin: auto 2px 0px 0px;
        height: 44px;
        line-height: 44px;
        font-size: 30px;
        color: #fff;
        font-weight: bold;
        background: url(@/public/img/27.png) no-repeat right 0px;
        background-size: 100% 102%;
        padding: 0px 33px;
        box-sizing: border-box;
    }

    .channel_nav_a_box {
        flex: 1;
        margin-top: auto;
        overflow: hidden;
    }

    .channel_nav_a {
        float: left;
        height: 24px;
        line-height: 24px;
        color: #333;
        font-size: 18px;
        margin: 3px 10px 7px;
        font-weight: bold;
        // width: 88px;
        box-sizing: border-box;
        text-align: center;
    }

    .channel_nav_a:nth-of-type(10n) {
        margin-right: 0px;
    }
}

.back100 {
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
</style>