From 0d8ff2e98da944b3d2f12af418ded35173dee0b6 Mon Sep 17 00:00:00 2001 From: zhengliming Date: Mon, 26 Feb 2024 21:26:31 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8Dslider=E6=BB=91?= =?UTF-8?q?=E5=9D=97=20=E4=BB=8Ev-show=E9=9A=90=E8=97=8F=E5=88=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=90=8E=EF=BC=8C=E5=87=BA=E7=8E=B0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E9=94=99=E8=AF=AF=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tuniao-ui/components/tn-slider/tn-slider.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tuniao-ui/components/tn-slider/tn-slider.vue b/tuniao-ui/components/tn-slider/tn-slider.vue index 3b3ed1d..c49fb21 100644 --- a/tuniao-ui/components/tn-slider/tn-slider.vue +++ b/tuniao-ui/components/tn-slider/tn-slider.vue @@ -149,6 +149,9 @@ }, // 滑动移动中 touchMove(event) { + this._tGetRect('.tn-slider').then(res => { + this.sliderRect = res + }); if (this.disabled) return if (!event.changedTouches[0]) return @@ -202,6 +205,9 @@ }, // 点击事件 click(event) { + this._tGetRect('.tn-slider').then(res => { + this.sliderRect = res + }) if (this.disabled) return // 直接点击的情况,计算方式和touchMove方法一致 const value = (((event.detail.x - this.sliderRect.left) / this.sliderRect.width) * (this.max - this.min)) + this.min