Slider: fix overflow

pull/22119/head
yangyi fu 2022-08-24 15:26:34 +08:00 committed by GitHub
parent acfc93a71f
commit d0b00633c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@
const lengthPerStep = 100 / ((this.max - this.min) / this.step); const lengthPerStep = 100 / ((this.max - this.min) / this.step);
const steps = Math.round(newPosition / lengthPerStep); const steps = Math.round(newPosition / lengthPerStep);
let value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min; let value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
value = parseFloat(value.toFixed(this.precision)); value = Math.min(parseFloat(value.toFixed(this.precision)), this.max);
this.$emit('input', value); this.$emit('input', value);
this.$nextTick(() => { this.$nextTick(() => {
this.displayTooltip(); this.displayTooltip();