To make the model update when the change event occurs, and not any time the user presses a key, you can use v-model.lazy
instead of just v.model
.
Working with input fields, v-model.trim
is useful because it automatically removes whitespace.
And if you accept a number instead than a string, make sure you use v-model.number
.