赞
踩
vue中v-for渲染,实现显示3条,数据arr.slice(0,3),即可取出arr数据的前三条
<div class="lc-item shadow-bd" v-for="(item,index) in newLessionList.slice(0,3)" @click="goBestStudy(item.id,item.courseId)" :key="index" >
<div class="lc-cover">
<img :src="item.packageCover" alt="">
</div>
<div class="lc-base">
<div class="ellipsis">{{item.packageName}}</div>
<p class="ellipsis" >{{item.courseName}}</p>
<span>更新于{{substringDate(item.createTime,5,16)}}</span>
</div>
</div>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。