<template>
    <section class="channel_1 clearfix">
        <div class="channel_head_box clearfix">
            <div class="channel_head_a_name_box clearfix">
                <NuxtLink :href="`/${pinyin}/index.html`" class="channel_head_a_name">
                    {{ name }}
                </NuxtLink>
            </div>
            <div class="channel_head_a_img_box back100"></div>
            <nav class="channel_nav_box clearfix">
                <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html` }" class="channel_head_a"
                    v-for="(item, index) in nav">{{ item.alias }}</NuxtLink>
            </nav>
        </div>
    </section>
</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_1 {
    width: 1200px;
    margin: 0 auto;
}

.channel_head_box {
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    border: solid 1px #D9D9D9;
    margin-top: 20px;
    margin-bottom: 15px;
    box-sizing: border-box;
    border-bottom: solid 2px #489D97;
    background: #fafafa;
    box-sizing: border-box;
    display: flex;
    align-items: center;

    .channel_nav_box {
        flex: 1;
        padding: 9px 0px;
    }

    .channel_head_a {
        position: relative;
        height: 18px;
        line-height: 18px;
        color: #333;
        font-size: 14px;
        border-top-left-radius: 3px;
        border-top-right-radius: 3px;
        float: left;
        padding: 0px 24px;
        text-align: center;
        box-sizing: border-box;
        margin: 5px 0px 5px -2px;
        // width: 101px;

        &:hover {
            color: #489D97;
        }
    }

    .channel_head_a::after {
        content: '';
        display: block;
        position: absolute;
        width: 2px;
        height: 12px;
        background: #DBDBDB;
        top: 3px;
        left: -1px;
    }
}

.channel_head_a_name_box {
    display: flex;
    margin-top: auto;
}

.channel_head_a_name {
    background: #489D97;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    padding: 0px 15px;
    position: relative;
    height: 44px;
    line-height: 44px;
    font-size: 18px;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    padding: 0px 15px;
    text-align: center;
}

.channel_head_a_img_box {
    width: 36px;
    height: 34px;
    float: left;
    background-image: url(@/public/img/25.png);
    margin: 0px 20px 0px 19px;
}

.channel_head_a:nth-of-type(1)::after,
.channel_head_a:nth-of-type(11)::after {
    content: '';
    display: none;
}
</style>