<template>
    <!-- 首页头条下面的新闻列表 -->
    <div class="list">
        <div class="inner">
            <ul>
                <li v-for="item in headlinelist1" class="left">
                    <!-- <i></i> -->
                    <NuxtLink :to="{path:`/newsDetail/${item.id}`,query:{listId:routeId,listName:routeName}}" :title="item.title">{{item.title}}</NuxtLink>
                </li>
            </ul>
        </div>
    </div>
</template>

<script setup>
const headlinelist1 = ref("")
async function getModelData1() {
    const { data: mkdata, error: mkdataError } =  requestData('/web/getWebsiteArticlett', {
        method: 'GET',
        query: {
            'pageSize': 2,
            'level': 1,
            'placeid': 2
        },
    });
    if (mkdataError.value) {
        //console.error('模块1数据上部分请求失败！', mkdataError.value);
    } else {
        if (mkdata.value) {
            //console.log('模块1数据上部分请求成功！', mkdata.value.data);
            headlinelist1.value = mkdata.value.data;
        }
    }
}
getModelData1()
</script>


<style lang="less" scoped>
// 列表
.list {
    height: 34px;
    margin: 16px 0 20px 0;

    .inner {
        height: 20px;
        margin: 0 auto;
    }

    ul {
        width: auto;
        height: 20px;
        box-sizing: border-box;
        padding-left: 180px;

        li:nth-child(1) {
            border-right: 1px solid #CCCCCC;
        }
        >li {
            width: 470px;
            margin-right: 30px;

            >i {
                display: inline-block;
                width: 13px;
                height: 13px;
                background-color: #d9d9d9;
                border-radius: 7px;
                // vertical-align: middle;
                margin-right: 10px;
            }

            >a {
                display: inline-block;
                width: 460px;
                height: 20px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-family: PingFang SC, PingFang SC;
                font-weight: 600;
                font-size: 18px;
                color: #333333;
                line-height: 16px;
                text-align: left;
                font-style: normal;
                text-transform: none;
                vertical-align: middle;
            }
        }

        >li:hover>i {
            background-color: #139602;
        }

        >li:hover>a {
            color: #139602;
        }
    }
}
</style>