From 500951aa8ea4ec423301082d1e9ee0f68fdbed4e Mon Sep 17 00:00:00 2001 From: duanzhijiang Date: Tue, 27 Sep 2022 19:10:52 +0800 Subject: [PATCH] =?UTF-8?q?TASK:=20#111576=20=E8=A7=A3=E9=99=A4=E5=88=9D?= =?UTF-8?q?=E5=A7=8Bheight=E8=A6=86=E7=9B=96=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/slider/slider.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/slider/slider.ts b/src/components/slider/slider.ts index 26650fb..fde930b 100644 --- a/src/components/slider/slider.ts +++ b/src/components/slider/slider.ts @@ -158,8 +158,8 @@ export class StarSlider extends LitElement { } } else { this.style.setProperty('--dot-move', this.barX + 'px') - this.progress.style.setProperty( - 'width', + this.style.setProperty( + '--cover-width', (this.barWidth * Math.ceil(this.proportion)) / 100 + 'px' ) } @@ -191,8 +191,8 @@ export class StarSlider extends LitElement { this.endValue = Math.ceil(this.proportion) + '' if (!this.tick) { this.style.setProperty('--dot-move', this.newX + 'px') - this.progress.style.setProperty( - 'width', + this.style.setProperty( + '--cover-width', (this.barWidth * Math.ceil(this.proportion)) / 100 + 'px' ) } else { @@ -238,7 +238,7 @@ export class StarSlider extends LitElement { //点击跳转 this.proportion = (this.dotL / this.barWidth) * 100 this.endValue = Math.ceil(this.proportion) + '' - this.vProgress.style.setProperty( + this.style.setProperty( '--cover-width', (this.barWidth * Math.ceil(this.proportion)) / 100 + 'px' ) @@ -264,7 +264,7 @@ export class StarSlider extends LitElement { this.proportion = (this.newY / this.barWidth) * 100 //取整 this.endValue = Math.ceil(this.proportion) + '' - this.vProgress.style.setProperty('--cover-width', this.newY + 'px') + this.style.setProperty('--cover-width', this.newY + 'px') } } private touchEndVertical(_: TouchEvent): string | void {