The v-model directive is used to create Two-Way Bindings in Vue js. In Two-Way Bindings, data or model binds with DOM, and Dom binds back to the model.
Let’s see an example to demonstrate how Two-Way Bindings is implemented.
- <div id=”app”>
- {{message}}
- <input v-model=”message”>
- </div>
- <script type=”text/javascript”>
- var message = ‘Vue.js is rad’;
- new Vue({ el: ‘#app’, data: { message } });
- </script>