|
@@ -6,7 +6,7 @@
|
|
|
<div class="client-container">
|
|
|
<h4 class="client-title-news">新闻资讯</h4>
|
|
|
<ul>
|
|
|
- <li style="font-size: 16px" v-for="(item, index) in newsData" :key="index">
|
|
|
+ <li style="font-size: 16px" v-for="(item, index) in curNewsData" :key="index">
|
|
|
<div>
|
|
|
<img :src="item.pic" alt="新闻资讯"/>
|
|
|
<h4 class="new_title" @click="checkInfo(item)">{{ item.title }}</h4>
|
|
@@ -23,7 +23,7 @@
|
|
|
<div class="client-newsInfo-phone mta-hidden-sm">
|
|
|
<h4 class="client-title-news">新闻资讯</h4>
|
|
|
<el-carousel :interval="5000" type="card" height="300px" indicator-position="none" arrow="never">
|
|
|
- <el-carousel-item v-for="(item,index) in newsData" @click="checkInfo(item)" :key="index" class="el-row">
|
|
|
+ <el-carousel-item v-for="(item,index) in curNewsData" @click="checkInfo(item)" :key="index" class="el-row">
|
|
|
<img :src="item.pic" alt="新闻资讯"/>
|
|
|
<div class="newsInfo-card-content">
|
|
|
<a style="display: none" :href="`${baseUrl}/news/${item.code}`"></a>
|
|
@@ -59,6 +59,9 @@ export default {
|
|
|
baseUrl() {
|
|
|
return this.getBaseUrl;
|
|
|
},
|
|
|
+ curNewsData() {
|
|
|
+ return this.newsData && this.newsData.length<4?this.newsData:this.newsData.slice(0,4)
|
|
|
+ },
|
|
|
...mapGetters(['getBaseUrl']),
|
|
|
},
|
|
|
methods: {
|