Answer the question
In order to leave comments, you need to log in
The value of input does not match v-model. How to solve the problem?
Here's a demo. https://jsfiddle.net/6t0jsz7h/2/
Let's say there is an input in which you can enter only phone numbers (a "+" sign and numbers).
I subscribe to the @input event, remove the forbidden characters, and put that value in the v-model variable.
The v-model value is correct, but the input itself displays illegal characters.
This will appear if you enter several invalid characters in a row. As soon as we enter an available one, input will take the correct value.
How to synchronize these values?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question