diff --git a/src/views/dataBoard/dataBoard.vue b/src/views/dataBoard/dataBoard.vue index 18c4a1c..c73f24d 100644 --- a/src/views/dataBoard/dataBoard.vue +++ b/src/views/dataBoard/dataBoard.vue @@ -403,7 +403,7 @@ }, // 初始化 Swiper initSwiper() { - if (this.swiperList.length === 0) return; + if (this.swiperList.length <= 1) return; this.swiperInstance = new Swiper('.swiper-container', { loop: true, grabCursor: true, @@ -421,7 +421,7 @@ }, // Swiper 滑动事件处理 onSwiperSlideChange() { - if (!this.swiperInstance || this.swiperList.length === 0) return + if (!this.swiperInstance || this.swiperList.length <= 1) return; // 获取当前索引 const realIndex = this.swiperInstance.activeIndex; this.currentSwiperIndex = realIndex;