<template>
    <div class="listNewsBox" v-if="componentStyle == 1">
        <div class="listNewsTitle">
            <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                <div>{{ titleLink.alias }}</div>
            </NuxtLink>
        </div>
        <!--样式1-->
        <div class="listNewsContent" v-if="component_style1_News1Array.length > 0">
            <div v-for="item in component_style1_News1Array">
                <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                    :target="item.islink == 1 ? '_blank' : '_self'">
                    <img :src="item.imgurl" alt="">
                    <span>{{ item.title }}</span>
                </NuxtLink>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import { ref } from 'vue';
//获得新闻数据
const props = defineProps({
    titleLink: Object,//板块名称
    templateData: Array,//新闻数据
    componentStyle: Number,//样式编号
});
//当前选中的tab
const activeTab = ref(0);

const component_style1_News1Array = ref([]);
//真实数据
component_style1_News1Array.value = props.templateData;

</script>

<style lang="less" scoped>
//基本样式 start ---------------------------------------->
.listNewsBox {
    position: relative;

    .listNewsTitle {
        height: 38px;
        line-height: 38px;
        margin-bottom: 19px;

        div {
            height: 35px;
            width: 138px;
            line-height: 32px;
            font-size: 22px;
            font-weight: bold;
            color: #333333;
            cursor: pointer;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #154079;
            padding-bottom: 5px;
            background: url("http://192.168.1.234:19000/pre/image/png/20251218/1766042138413493.png") bottom left no-repeat;
        }
    }

    .listNewsContent {
        position: relative;

        div {
            a {
                img {
                    width: 374px;
                    height: 264px;
                }

                span {
                    display: inline-block;
                    width: 374px;
                    height: 50px;
                    line-height: 50px;
                    font-size: 16px;
                    font-weight: bold;
                    color: #fff;
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    padding-left: 15px;
                    background-color: rgba(0, 0, 0, 0.2);
                }
            }
        }
    }
}

//基本样式 end ----------------------------------------></style>