How to create Two-Way Bindings in Vue.js?

devquora
devquora

Posted On: Feb 22, 2018

 

v-model directive is used to create Two-Way Bindings in Vue js.In Two-Way Bindings data or model is bind with DOM and Dom is binded back to model.

In below example you can see 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>

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Vue.js Interview Questions

    What is Vue.js?

    Vue js is progressive javascript script used to create dynamic user interfaces.Vue js is very easy to learn.In order to..

    Vue.js Interview Questions

    List some features of Vue.js.

    Vue js comes with following features Templates Reactivity Components Transitions Routing ..

    Vue.js Interview Questions

    Explain Life cycle of Vue Instance.

    The Life cycle of each Vue instance goes through a series of initialization steps when it is created. – for example, ..