From 4c839f1f5116850174eb4794a9716bd45aad308e Mon Sep 17 00:00:00 2001 From: hdx Date: Tue, 16 Jan 2024 14:11:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(swiper-list2):=20=E9=80=82=E9=85=8D=20web?= =?UTF-8?q?=20=E5=B9=B3=E5=8F=B0=EF=BC=8C=E5=9C=A8=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E4=B8=AA/=E7=AC=AC=E4=B8=80=E4=B8=AA=20item=20?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=86=8D=E6=AC=A1=E6=BB=91=E5=8A=A8=E5=87=BA?= =?UTF-8?q?=E7=8E=B0tab=E6=94=BE=E5=A4=A7=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/swiper-list2/swiper-list2.uvue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pages/template/swiper-list2/swiper-list2.uvue b/pages/template/swiper-list2/swiper-list2.uvue index d5aa4505..e52b65dd 100644 --- a/pages/template/swiper-list2/swiper-list2.uvue +++ b/pages/template/swiper-list2/swiper-list2.uvue @@ -81,7 +81,9 @@ const percentage = Math.abs(current_offset_x) / this.swiperWidth // 通知更新指示线 - this.updateTabIndicator(current_index, move_to_index, percentage) + if (current_index != move_to_index) { + this.updateTabIndicator(current_index, move_to_index, percentage) + } }, onSwiperAnimationfinish(e : SwiperAnimationFinishEvent) { this.setSwiperIndex(e.detail.current, true) @@ -108,8 +110,8 @@ const max_ratio = 1.3 const tabs = this.$refs['swipertab'] as UniElement[] - const current_node = tabs[current_index]! - const move_to_node = tabs[move_to_index]! + const current_node = tabs[current_index] + const move_to_node = tabs[move_to_index] // 当前 const current_scale = lerpNumber(min_ratio, max_ratio, 1 - percentage) -- GitLab