fix(components): [el-input-number]set value equal to min will update (#4650)

This commit is contained in:
Alan Wang 2021-12-07 20:05:52 -05:00 committed by GitHub
parent 5beaf750f3
commit 59ea340e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,11 +241,11 @@ export default defineComponent({
newVal = toPrecision(newVal, props.precision)
}
}
if (newVal !== undefined && newVal >= props.max) {
if (newVal !== undefined && newVal > props.max) {
newVal = props.max
emit('update:modelValue', newVal)
}
if (newVal !== undefined && newVal <= props.min) {
if (newVal !== undefined && newVal < props.min) {
newVal = props.min
emit('update:modelValue', newVal)
}