- <swiper
- v-if="tabs[activeTab].data.tabInfo.banners.length !== 0"
- class="shop-swiper"
- autoplay
- current="currentNum"
@change="changeCurrent"
>
<swiper-item
v-for="(item, index) in tabs[activeTab].data.tabInfo.banners" - key="index"
@click="jump(item)"
>
<image class="swiper-images" :src="item.banner_img.url" mode="widthFix"/>
</swiper-item>
</swiper>
currentNum 初始值为0
changeCurrent(e) {
this.currentNum = e.detail.current;
},
有时第一次就会出现这个问题,切换页面tab后就消失了
2 个回复
1***@qq.com
请问你的问题解决了吗?我想监听current 在第几个模块 可就是监听不到,不知道有什么办法解决
2***@qq.com
interval='5000'
@tap-Banner='tapBanner'
v-if='isrefresh'></swiperBanner>
// 点击轮播图
tapBanner(e, type) {
console.log(e, '轮播图操作返回的数据');
if (type === 'delete') { // 监听到时删除,强制刷新
this.isrefresh = false;
this.$nextTick(function() {
this.info = e;
this.isrefresh = true;
});
} else {
this.info = e;
}
},