in Vue.JS by

How do you implement two-way binding?

▼ Show 1 Answer

0 votes

You can use the v-model directive to create two-way data bindings on form input, textarea, and select elements. Lets take an example of it using input component,

<input v-model="message" placeholder="Enter input here">
<p>The message is: {{ message }}</p>

Remember, v-model will ignore the initial valuechecked or selected attributes found on any form elements. So it always use the Vue instance data as the source of truth.

Vue JS
Learn More with Madanswer

Related questions

0 votes
asked Oct 21, 2019 in Vue.JS by Tate