|
|
@@ -125,7 +125,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <swiper slides-per-view="auto" :space-between="16" class="mySwiper">
|
|
|
+ <swiper @swiper="setSwiperRef" slides-per-view="auto" :space-between="16" class="mySwiper">
|
|
|
<swiper-slide class="tab-slide" v-for="item in tabs" :key="item.id">
|
|
|
<div class="tab-top">
|
|
|
<img src="@assets/png-sosuo-bg.png" alt="" />
|
|
|
@@ -168,6 +168,15 @@ export default {
|
|
|
components: { ProductInfo, Swiper, SwiperSlide },
|
|
|
inject: ['bar', 'setKeeps', 'scrollWrapper', 'changeScroll'],
|
|
|
mixins: [product, list, search],
|
|
|
+ setup() {
|
|
|
+ let swiperRef = null;
|
|
|
+
|
|
|
+ const setSwiperRef = swiper => {
|
|
|
+ swiperRef = swiper;
|
|
|
+ };
|
|
|
+
|
|
|
+ return { swiperRef: null, setSwiperRef };
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
list: [],
|
|
|
@@ -295,7 +304,9 @@ export default {
|
|
|
.then(res => {
|
|
|
this.banners = res.content;
|
|
|
this.$nextTick(() => {
|
|
|
- console.log(this.tabs);
|
|
|
+ if (this.swiperRef) {
|
|
|
+ this.swiperRef.update();
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
})
|