Skip to content

Commit

Permalink
fix: slider兼容step为字符串类型
Browse files Browse the repository at this point in the history
  • Loading branch information
jry committed Aug 30, 2024
1 parent 286eb02 commit b558269
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/uni_modules/uview-plus/components/up-slider/up-slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,24 +376,24 @@
switch (index) {
case 0:
return Math.round(
Math.max(this.min, Math.min(value, this.rangeValue[1] - this.step,this.max))
/ this.step
) * this.step;
Math.max(this.min, Math.min(value, this.rangeValue[1] - parseInt(this.step),this.max))
/ parseInt(this.step)
) * parseInt(this.step);
break;
case 1:
return Math.round(
Math.max(this.min, this.rangeValue[0] + this.step, Math.min(value, this.max))
/ this.step
) * this.step;
Math.max(this.min, this.rangeValue[0] + parseInt(this.step), Math.min(value, this.max))
/ parseInt(this.step)
) * parseInt(this.step);
break;
default:
break;
}
} else {
return Math.round(
Math.max(this.min, Math.min(value, this.max))
/ this.step
) * this.step;
/ parseInt(this.step)
) * parseInt(this.step);
}
}
}
Expand Down

0 comments on commit b558269

Please sign in to comment.