Skip to main content

Vue js v-model


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

 Modifiers:

* .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
 
* .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 elament type="number", the value of the element always return as string.
 
* .trim (v-model.trim)

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

Comments