Entering a negative number in the official instance of the iview InputNumber component automatically becomes the minimum value, but it is not actually in the code

<template>
    <InputNumber :max="10" :min="1" v-model="value1"></InputNumber>
</template>
<script>
    export default {
        data () {
            return {
                value1: 1
            }
        }
    }
</script>

official example

typing-1 in this official instance automatically becomes 1, but copying this code to the actual page has no such effect. It only becomes 1

when you lose focus.
Jun.04,2021

you can use the latest v3.1.0

.

the main change is: https://github.com/iview/ivie.

Core or input event:

@input="change"
All previous versions of

are in the change method:

directly put

if (event.type == 'input' && val < min) return;
if (val > max) {
    this.setValue(max);
} else if (val < min) {
    this.setValue(min);
} else {
    this.setValue(val);
}

changed to: the input value and size judgment are not handled here, and the return when the value is less than the minimum value

is not handled here.
this.setValue(val);
Menu