<template>
    <!-- 样式1 -->
    <div class="BannerListBox BannerListBoxStyle1" v-if="componentStyle == 1">
        <div v-for="item in component_News" :key="item.id">
            <NuxtLink 
                :href="getLinkPathDetail(item)" 
                :title="item.title"
                :target="item.islink == 1 ? '_blank' : '_self'"
            >
                {{ item.title }}
            </NuxtLink>
        </div>
    </div>
    <!-- 样式2 -->
    <div class="BannerListBox BannerListBoxStyle2" v-if="componentStyle == 2">
        <div v-for="item in component_News" :key="item.id">
            <NuxtLink 
                :href="getLinkPathDetail(item)" 
                :title="item.title"
                :target="item.islink == 1 ? '_blank' : '_self'"
            >
                {{ item.title }}
            </NuxtLink>
        </div>
    </div>
    <!-- 样式3 -->
    <div class="BannerListBox BannerListBoxStyle3" v-if="componentStyle == 3">
        <div v-for="item in component_News" :key="item.id">
            <NuxtLink 
                :href="getLinkPathDetail(item)" 
                :title="item.title"
                :target="item.islink == 1 ? '_blank' : '_self'"
            >
                {{ item.title }}
            </NuxtLink>
        </div>
    </div>
    <!-- 样式4 -->
    <div class="BannerListBox BannerListBoxStyle4" v-if="componentStyle == 4">
        <div v-for="item in component_News" :key="item.id">
            <NuxtLink 
                :href="getLinkPathDetail(item)" 
                :title="item.title"
                :target="item.islink == 1 ? '_blank' : '_self'"
            >
                {{ item.title }}
            </NuxtLink>
        </div>
    </div>
    <!-- 样式5 -->
    <div class="BannerListBox BannerListBoxStyle5" v-if="componentStyle == 5">
        <div v-for="item in component_News" :key="item.id">
            <NuxtLink 
                :href="getLinkPathDetail(item)" 
                :title="item.title"
                :target="item.islink == 1 ? '_blank' : '_self'"
            >
                {{ item.title }}
            </NuxtLink>
        </div>
    </div>
</template>

<script setup>
//引入vue
import { ref } from 'vue';
//获得新闻数据
const props = defineProps({
    componentStyle: Number,//样式编号
    templateData: Array,//新闻数据
});
//获取新闻数据
const component_News = ref(props.templateData);
</script>

<style lang="less" scoped>
//基本样式 start ---------------------------------------->
.BannerListBox {
    div {
        cursor: pointer;
        font-size: 18px;
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 26px;
        line-height: 26px;
        margin-bottom: 16px;

        a {
            font-size: 18px;
            color: #333;
        }

        &:last-child {
            margin-bottom: 0;
        }
    }
}

//基本样式 end ---------------------------------------->
//样式1 start ---------------------------------------->
.BannerListBoxStyle1 {
    div {
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 26px;
        line-height: 26px;
        margin-bottom: 16px;

        a {
            font-size: 18px;
            color: #333;
        }

        &:nth-child(1),
        &:nth-child(6) {
            a {
                color: #004564;
                font-weight: bold;
            }
        }

        &:last-child {
            margin-bottom: 0;
        }
    }
}

//样式1 end ---------------------------------------->
//样式2 start ---------------------------------------->
.BannerListBoxStyle2 {
    div {
        a {
            color: #333;
        }

        &:nth-child(1),
        &:nth-child(6) {
            a {
                color: #333333;
                font-weight: bold;
            }
        }

        &:last-child {
            margin-bottom: 0;
        }
    }
}
//样式2 end ---------------------------------------->
//样式3
.BannerListBoxStyle3 {
    div {
        a {
            color: #333;
        }

        &:nth-child(1){
            a {
                color: #004564;
                font-weight: bold;
            }
        }

        &:last-child {
            margin-bottom: 0;
        }
    }
}
//样式4
.BannerListBoxStyle4 {
    div {
        a {
            color: #333;
        }

        &:nth-child(1){
            a {
                color: #333333;
                font-weight: bold;
            }
        }

        &:last-child {
            margin-bottom: 0;
        }
    }
}
//样式5
.BannerListBoxStyle5 {
    div{
        a {
            color: #333;
        }
    }
}
// </style>