Vue.js Modifiers Input Modifiers

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

  • .trim

If you want user input to be trimmed automatically, you can add the trim modifier to your v-model managed inputs:

<input v-model.trim="msg">
  • .number

If you want user input to be automatically typecast as a number, you can do as follow:

<input v-model.number="age" type="number">
  • .lazy

Generally, v-model syncs the input with the data after each input event, but you can add the lazy modifier to instead sync after change events:

<input v-model.lazy="msg" >


Got any Vue.js Question?