diff --git a/src/components/slider/slider.vue b/src/components/slider/slider.vue index cb8399f..0cfe445 100644 --- a/src/components/slider/slider.vue +++ b/src/components/slider/slider.vue @@ -170,11 +170,13 @@ return (val[1] - this.min) / (this.max - this.min) * 100; }, barStyle () { + const style = { - left: (this.currentValue[0] - this.min) / (this.max - this.min) * 100 + '%' + width: (this.currentValue[0] - this.min) / (this.max - this.min) * 100 + '%' }; if (this.range) { + style.left = (this.currentValue[0] - this.min) / (this.max - this.min) * 100 + '%'; style.width = (this.currentValue[1] - this.currentValue[0]) / (this.max - this.min) * 100 + '%'; } -- libgit2 0.21.4