| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- <template>
- <div class="listNewsBox">
- <!-- 样式1 -->
- <div class="newsListSector" v-if="componentStyle == 1">
- <div v-for="item in listData.slice(0, 3)" class="photoText">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img src="https://img.bjzxtw.org.cn/pre/image/png/20251112/1762939232690115.png" alt="">
- <div class="newsListSectorRight">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </div>
- </NuxtLink>
- </div>
- <div v-for="item in listData.slice(3, 10)" class="text">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </NuxtLink>
- </div>
- </div>
- <!-- 样式2 -->
- <div class="newsListSector style2" v-if="componentStyle == 2">
- <div v-for="item in listData.slice(0, 3)" class="photoText">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img src="https://img.bjzxtw.org.cn/pre/image/png/20251112/1762939232690115.png" alt="">
- <div class="newsListSectorRight">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </div>
- </NuxtLink>
- </div>
- <div v-for="item in listData.slice(3, 10)" class="text">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </NuxtLink>
- </div>
- </div>
- <!-- 样式3 -->
- <div class="newsListSector style3" v-if="componentStyle == 3">
- <div v-for="item in listData.slice(0, 3)" class="photoText">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img src="https://img.bjzxtw.org.cn/pre/image/png/20251112/1762939232690115.png" alt="">
- <div class="newsListSectorRight">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </div>
- </NuxtLink>
- </div>
- <div v-for="item in listData.slice(3, 10)" class="text">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </NuxtLink>
- </div>
- </div>
- <!-- 样式4 -->
- <div class="newsListSector style4" v-if="componentStyle == 4">
- <div v-for="item in listData.slice(0, 3)" class="photoText">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <img src="https://img.bjzxtw.org.cn/pre/image/png/20251112/1762939232690115.png" alt="">
- <div class="newsListSectorRight">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </div>
- </NuxtLink>
- </div>
- <div v-for="item in listData.slice(3, 10)" class="text">
- <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
- :target="item.islink == 1 ? '_blank' : '_self'">
- <span class="title">{{ item.title }}</span>
- <p class="desc">{{ item.introduce }}</p>
- <span class="time">{{ item.updated_at }}</span>
- </NuxtLink>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- //引入vue
- import { ref } from 'vue';
- //获得新闻数据
- const props = defineProps({
- listData: Array,//新闻数据
- componentStyle: Number//组件样式
- });
- </script>
- <style lang="less" scoped>
- //基本样式 start ---------------------------------------->
- .listNewsBox {
- .newsListSector {
- .photoText {
- width: 100%;
- height: 180px;
- border-bottom: 1px dashed #cbcbcb;
- margin-bottom: 30px;
- cursor: pointer;
- a {
- display: flex;
- img {
- width: 220px;
- height: 160px;
- }
- .newsListSectorRight {
- height: 160px;
- padding-left: 30px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- .title {
- display: block;
- width: 664px;
- height: 24px;
- line-height: 24px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- color: #333333;
- font-size: 23px;
- font-weight: bold;
- margin-bottom: 20px;
- }
- .desc {
- height: 63px;
- line-height: 20px;
- color: #666666;
- font-size: 18px;
- font-family: "Abhaya Libre", serif;
- margin-bottom: 20px;
- }
- .time {
- font-family: "Abhaya Libre", serif;
- font-size: 18px;
- color: #666666;
- }
- }
- }
- }
- .text {
- width: 100%;
- height: 175px;
- border-bottom: 1px dashed #cbcbcb;
- margin-bottom: 30px;
- cursor: pointer;
- a {
- color: #333333;
- .title {
- display: block;
- width: 900px;
- height: 24px;
- line-height: 24px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- color: #333333;
- font-size: 23px;
- font-weight: bold;
- margin-bottom: 20px;
- }
- .desc {
- height: 63px;
- line-height: 20px;
- color: #666666;
- font-size: 18px;
- font-family: "Abhaya Libre", serif;
- margin-bottom: 20px;
- overflow: hidden;
- }
- .time {
- font-family: "Abhaya Libre", serif;
- font-size: 18px;
- color: #666666;
- }
- }
- }
- }
- //样式2
- .style2 {
- .photoText {
- border-bottom: 1px solid #cbcbcb;
- }
- .text {
- border-bottom: 1px solid #cbcbcb;
- }
- }
- //样式3
- .style3 {
- .photoText {
- a {
- .newsListSectorRight {
- .title {
- font-weight: 400;
- }
- }
- }
- }
- .text {
- a {
- .title {
- font-weight: 400;
- }
- }
- }
- }
- //样式4
- .style4 {
- .photoText {
- border-bottom: 1px solid #cbcbcb;
- a {
- .newsListSectorRight {
- .title {
- font-weight: 400;
- }
- }
- }
- }
- .text {
- border-bottom: 1px solid #cbcbcb;
- a {
- .title {
- font-weight: 400;
- }
- }
- }
- }
- }
- //基本样式 end ----------------------------------------></style>
|