提交 5d109735 编写于 作者: 芊里

banner缺省图逻辑调整

上级 625627ea
......@@ -9,10 +9,10 @@
<!-- banner -->
<unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" :collection="collection"
:field="field" @load="load">
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem="clickItem" :info="bannerFormate(data)"
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem="clickItem" :info="bannerFormate(data, loading)"
:current="current" :mode="mode" :dots-styles="dotsStyles" field="content">
<swiper class="swiper-box" @change="changeSwiper" :current="swiperDotIndex">
<swiper-item v-for="(item, index) in bannerFormate(data)" :key="item._id">
<swiper-item v-for="(item, index) in bannerFormate(data, loading)" :key="item._id">
<view :draggable="false" class="swiper-item" @click="clickBannerItem(item)">
<image class="swiper-image" :src="item.bannerfile" mode="aspectFill" :draggable="false" />
</view>
......@@ -119,7 +119,9 @@
current: 0,
mode: 'default',
dotsStyles: {},
swiperDotIndex: 0
swiperDotIndex: 0,
isLoading:true
}
},
methods: {
......@@ -181,7 +183,8 @@
/**
* banner数据过滤
*/
bannerFormate(bannerList) {
bannerFormate(bannerList, loading) {
if (loading) return [];
if (bannerList.length > 0) return bannerList;
// 无数据添加默认值
let list = [{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册