<template>
    <div class="navigate">
        <div class="partOne">
            <div class="inner">
                <div class="navLeft">
                    <div class="navIndex">
                        <NuxtLink :to="'/'">
                            首页
                        </NuxtLink> 
                    </div>
                    <div class="navClass">
                        <div>
                            主题资讯
                        </div>
                        <div>
                            互动资讯
                        </div>
                    </div>
                </div>
                <ul class="navigationOne">
                    <li v-for="(item, index) in navigation1" :key="index">
                        <NuxtLink :to="'/primaryNavigation/' + item.category_id" v-if="item.children_count != 0" :title="item.alias">
                            <span class="active" v-if="item.category_id == routeId">{{ item.alias }}</span>
                            <span v-else>{{ item.alias }}</span>
                        </NuxtLink>
                        <NuxtLink :to="'/newsList/' + item.category_id" v-if="item.children_count == 0 && item.is_url != 1" :title="item.alias">
                            <span class="active" v-if="item.category_id == routeId">{{ item.alias }}</span>
                            <span v-else>{{ item.alias }}</span>
                        </NuxtLink>
                        <NuxtLink :to="item.web_url"v-if="item.children_count == 0 && item.is_url == 1" :title="item.alias">
                            <span class="active" v-if="item.category_id == routeId">{{ item.alias }}</span>
                            <span v-else>{{ item.alias }}</span>
                        </NuxtLink>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</template>

<script setup>
const navigation1 = ref("");
async function getPageData2() {
    const mkdata =  await requestDataPromise('/web/getWebsiteModelCategory', {
        method: 'GET',
        query: {
            'placeid': 1,
            'pid': 0,
            'num': 35
        },
    });
    navigation1.value = mkdata.data;
}
getPageData2();
</script>

<style lang="less" scoped>
@import url('@/assets/css/nav.less');
</style>