chore: rename range to clamp (#8903)

* chore: rename range to clamp

* chore: merge upstream
This commit is contained in:
neverland
2021-06-21 16:20:03 +08:00
committed by GitHub
parent 8fb8055243
commit e0bfb44d3c
8 changed files with 34 additions and 35 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import { ref, computed, PropType, CSSProperties, defineComponent } from 'vue';
// Utils
import {
range,
clamp,
addUnit,
addNumber,
getSizeStyle,
@@ -108,7 +108,7 @@ export default defineComponent({
const max = +props.max;
const step = +props.step;
value = range(value, min, max);
value = clamp(value, min, max);
const diff = Math.round((value - min) / step) * step;
return addNumber(min, diff);
};