<template>
    <div class="onlyImgSectorBox">
        <div class="onlyImgSector">
            <!--组件皮肤1-->
            <div v-if="skinId==1">
                <main1Style 
                    :titleLink="componentTitle1" 
                    :templateData="templateData[0].componentData.data"
                    :componentStyle="templateData[0].component_style" 
                    :templateAdData="templateAdData"
                />
            </div>
            <!--组件皮肤2-->
            <div v-if="skinId==2">
                <main2Style 
                    :titleLink="componentTitle1" 
                    :templateData="templateData[0].componentData.data"
                    :componentStyle="templateData[0].component_style" 
                    :templateAdData="templateAdData"
                />
            </div>
            <!--组件皮肤3-->
            <div v-if="skinId==3">
                <main3Style 
                    :titleLink="componentTitle1" 
                    :templateData="templateData[0].componentData.data"
                    :componentStyle="templateData[0].component_style" 
                    :templateAdData="templateAdData"
                />
            </div>
            <!--组件皮肤4-->
            <div v-if="skinId==4">
                <main4Style 
                    :titleLink="componentTitle1" 
                    :templateData="templateData[0].componentData.data"
                    :componentStyle="templateData[0].component_style" 
                    :templateAdData="templateAdData"
                />
            </div>
        </div>
    </div>
</template>

<script setup>
//组件皮肤1
import main1Style from '@/components/template/component/list/1200x480/1.vue'
//组件皮肤2
import main2Style from '@/components/template/component/list/1200x480/2.vue'
//组件皮肤3
import main3Style from '@/components/template/component/list/1200x480/3.vue'
//组件皮肤4
import main4Style from '@/components/template/component/list/1200x480/4.vue'
const props = defineProps({
    skinId: Number,//皮肤id
    templateData:Object,//新闻数据
    adData: Array,//广告池
    adTag: String,//广告标识
});
//该通栏下只有1个组件
const componentTitle1 = {
    alias:props.templateData[0].componentData.data.alias,
    aLIas_pinyin:props.templateData[0].componentData.data.pinyin,
    is_url: props.templateData[0].componentData.data.is_url ?? 0,//如果is_url为空 则默认为0
    children_count: props.templateData[0].componentData.data.children_count ?? 0,//如果children_count为空 则默认为0
    cid:props.templateData[0].componentData.data.category_id
}
//该通栏含有1个广告
const templateAdData = requestAd(props.adData,props.adTag)
</script>

<style lang="less" scoped>
//基本样式 start ---------------------------------------->
.onlyImgSectorBox {
    width: 100%;
    height: 480px;
    margin-bottom: 30px;
    .onlyImgSector {
        width: 1200px;
        height: 480px;
        margin: 0 auto;
        box-sizing: content-box;
        position: relative;
    }
}
//基本样式 end ---------------------------------------->
</style>