The InputNumber number input box is limited to a maximum of two decimal places

for example, 0.333
can only enter 0.33

.
Jun.17,2022

use native input, it is good to bind a custom instruction, or bind the model value to input, watch callback limit. If you can ignore the styling problem of inputNumber, of course, you have to consider that it can enter operators


you are using element UI InputNumber?
if you are configuring precision precision= "2" pay attention to the documentation


you can refer to this example https://jsfiddle.net/0nmoj45r/2/


element UI is recommended,
clipboard.png

https://element.faas.ele.me/-sharp...
if it is an input component, you can listen through watch or use the hook function of change to judge


oninput= "if (isNaN (value)) {value= null} if (value.indexOf ('.') > 0) {value=value.slice (0quotient value.indexof ('.) + 3)}"

Menu