Vue js v-model

Vue js v-model

In vue js v-model used to two way binding on input and text area elements
 Modifiers:

1 .lazy (v-model.lazy)

- By default vue js sync input with the data after each input event, If you want to apply changes after "change" instead of "input" you can use .lazy mpdofier

 

2 .number (v-model.number)

- If you want user input automatic typecast as a number, then you can use .number modifier

- Thanks to modifier .number, because if you use HTML5 element type="number", the value of the element always return as string.

 

3 .trim (v-model.trim)

- .trim modifier is used to trimmed user input automatically.