Vue.js Getting started with Vue.js Handling User Input


Example

VueJS can be used to easily handle user input as well, and the two way binding using v-model makes it really easy to change data easily.

HTML :

<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id="app">
    {{message}}
<input v-model="message"> 
</div>

JS :

new Vue({
  el: '#app',
  data: {
    message: 'Hello Vue.js!'
  }
})

It is very easy to do a two-way binding in VueJS using v-model directive.

Check out a live example here.