mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(Range): progress style (#385)
This commit is contained in:
@@ -128,8 +128,11 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const progressStyle = computed(() => {
|
||||
const { modelValue, min, max } = props
|
||||
const clampedValue = Math.max(min, Math.min(modelValue, max))
|
||||
const relativeValue = (clampedValue - min) / (max - min)
|
||||
return {
|
||||
width: `${(props.modelValue / props.max) * 100}%`
|
||||
width: `${relativeValue * 100}%`
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user