From 592ce0dd731474b244cca6bda95cc6561ddcaf2f Mon Sep 17 00:00:00 2001 From: hdx Date: Tue, 12 Sep 2023 14:28:44 +0800 Subject: [PATCH] =?UTF-8?q?swiper-list2:=20=E5=A4=84=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/swiper-list2/swiper-list2.uvue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pages/template/swiper-list2/swiper-list2.uvue b/pages/template/swiper-list2/swiper-list2.uvue index d94d7027..c707db8c 100644 --- a/pages/template/swiper-list2/swiper-list2.uvue +++ b/pages/template/swiper-list2/swiper-list2.uvue @@ -112,14 +112,14 @@ // 当前 const current_scale = lerpNumber(min_ratio, max_ratio, 1 - percentage) - current_node.style?.setProperty('transform', `scale(${current_scale})`) + current_node.style.setProperty('transform', `scale(${current_scale})`) // 目标 const move_to_scale = lerpNumber(min_ratio, max_ratio, percentage) - move_to_node.style?.setProperty('transform', `scale(${move_to_scale})`) + move_to_node.style.setProperty('transform', `scale(${move_to_scale})`) // 滚动到水平中心位置 - const target_x = current_node.offsetLeft + (move_to_node.offsetLeft - current_node.offsetLeft) * percentage + const target_x = lerpNumber(current_node.offsetLeft, move_to_node.offsetLeft, percentage) const center_x = target_x + move_to_node.offsetWidth / 2 - this.$swiperWidth / 2 this.$tabScrollView?.setAttribute('scrollLeft', center_x) } @@ -139,8 +139,7 @@ .swiper-tabs-item { color: #555; font-size: 16px; - margin: 12px 25px 5px 25px; - /* transform-origin: left bottom; */ + margin: 15px 25px 5px 25px; } .swiper-tabs-item-active { -- GitLab