From 33b99b99ed6871732b66e0f3388916f84a8bac89 Mon Sep 17 00:00:00 2001 From: hdx Date: Tue, 29 Aug 2023 19:01:10 +0800 Subject: [PATCH] =?UTF-8?q?swiper:=20=E4=BC=98=E5=8C=96=E8=9B=87=E5=BD=A2?= =?UTF-8?q?=E7=BA=BF=E5=9C=A8=E5=BF=AB=E9=80=9F=E8=BF=9E=E7=BB=AD=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E8=BF=87=E7=A8=8B=E4=B8=AD=E6=8A=96=E5=8A=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/long-list/long-list.uvue | 2 +- pages/template/swiper-list/swiper-list.uvue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index 855cd76d..3418f016 100644 --- a/pages/template/long-list/long-list.uvue +++ b/pages/template/long-list/long-list.uvue @@ -98,7 +98,7 @@ if (moveToIndex < 0) { moveToIndex = 0 } if (moveToIndex > this.$swiperTabsRect.length - 1) { moveToIndex = this.$swiperTabsRect.length - 1 } - const percentage = Math.abs(offsetX) / this.$swiperWidth + const percentage = Math.abs(offsetX % this.$swiperWidth) / this.$swiperWidth const currentSize = this.$swiperTabsRect[currentIndex] const moveToSize = this.$swiperTabsRect[moveToIndex] const indicatorlineL = currentSize.left + (moveToSize.left - currentSize.left) * percentage diff --git a/pages/template/swiper-list/swiper-list.uvue b/pages/template/swiper-list/swiper-list.uvue index 02819a4e..f0dcfc87 100644 --- a/pages/template/swiper-list/swiper-list.uvue +++ b/pages/template/swiper-list/swiper-list.uvue @@ -73,7 +73,7 @@ if (moveToIndex < 0) { moveToIndex = 0 } if (moveToIndex > this.$swiperTabsRect.length - 1) { moveToIndex = this.$swiperTabsRect.length - 1 } - const percentage = Math.abs(offsetX) / this.$swiperWidth + const percentage = Math.abs(offsetX % this.$swiperWidth) / this.$swiperWidth const currentSize = this.$swiperTabsRect[currentIndex] const moveToSize = this.$swiperTabsRect[moveToIndex] const indicatorlineL = currentSize.left + (moveToSize.left - currentSize.left) * percentage -- GitLab