因为刚开始页面渲染数据还没加载过来,所以第一页无数据。
只要el-carousel-item里的for循环有默认长度即可:
<el-carousel
:autoplay="false"
arrow="never"
indicator-position="none"
:loop="false"
v-if="steam.heatPumpCrews[0].shebeiMingZi" //加上这句没数据不显示就好了
ref="cardShow"
>
<el-carousel-item
v-for="item in steam.heatPumpCrews"//这个循环必须有初始数据
:key="item.name"
>
//内容
</el-carousel-item>
</el-carousel>