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


        <div class="phone_nav pc_none">
            <div class="phone_nav_in">
                <NuxtLink :to="{ path: `/${targetRoute}/${item.aLIas_pinyin}/list-1.html`}"          
                 class="phone_nav_a" 
                    v-for="(item, index) in nav" :key="index">
                    {{ item.alias }}
                </NuxtLink>


            </div>
        </div>


    </main>
</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>
.index{
    width: 1200px;
    margin: 0 auto;
}
.channel_nav {
    background: #A91B33;
    margin: 20px auto 0px;
    position: relative;
    z-index: 11;
    display: flex;

    .channel_nav_a_head {
        word-break: keep-all;
        white-space: nowrap;
        display: block;
        background: #fff;
        border-top-left-radius: 7px;
        border-top-right-radius: 7px;
        position: relative;
        z-index: 22;
        font-size: 16px;
        font-weight: bold;
        height: 51px;
        line-height: 42px;
        color: #A91B33;
        margin: auto 21px 0px 35px;
        padding: 0px 40px;
    }

    .channel_nav_a_head::before {
        content: '';
        display: block;
        position: absolute;
        width: 64px;
        height: 2px;
        background: #A91B33;
        left: 50%;
        margin-left: -32px;
        bottom: 10px;
    }


    .channel_nav_right {
        flex: 1;
        padding: 10px 0px;
    }

    .channel_nav_a {
        float: left;
        height: 22px;
        line-height: 22px;
        position: relative;
        color: #fff;
        font-size: 16px;
        font-weight: bold;
        margin: 5px 13.5px;
        text-align: center;
        width: 96px;
    }

    .channel_nav_a::after {
        content: '';
        display: block;
        position: absolute;
        width: 1px;
        height: 14px;
        background: #BF3519;
        left: -14px;
        top: 5px;
    }

}
</style>


<style lang="less" scoped>

 
    @media screen and (min-width:801px){/*pc*/
         
		
            .pc_none{display:none;}
    }
    @media screen and (max-width:800px){/*ipad_phone*/
            .index{width:100%;}
            .index_main{width:100%;}
            .index_nav{width:100%;}             
             .phone_nav{ 

                width:100%; box-sizing:border-box;background:#fafafa; 
                margin:10px auto;height:33px;

                .phone_nav_in{ width:92%;margin:0px auto;
                    overflow-x:auto;overflow-y:hidden; 
                    word-break: keep-all; white-space: nowrap;    
                       line-height:33px;
                        height:33px;
                }
                .phone_nav_in::-webkit-scrollbar{height:0px;}


                .phone_nav_a{display:inline-block;line-height:33px;height:33px;
                    color:#333;font-size:14px;margin:0px 10px;
                }
                .phone_nav_a:nth-of-type(1){margin-left:0px; }

                
                .phone_nav_in .router-link-exact-active.phone_nav_a{
                    color:#a91b33;
                }
            }

            .phone_none{display:none;}
    }


</style>