DEV Community

Ellis
Ellis

Posted on

How to Add `v-model` Support to Custom Vue.js Component

v-model is one of the few directives that comes with Vue.js. The thing that makes it great is the fact that it allows for two-way data binding between our data and views.

With two-way data binding, when we update data via input fields or whatever, we can modify the DOM without having to do DOM work.

What you will learn in this video:

  • How v-model works internally
  • How to add v-model to custom components
  • Customizing v-model prop and event

Add "v-model" directive on custom input Component

Learn Vue.js 2

Top comments (0)