Vue - v-model directive for two-way data bindings on form input

0 votes
added Oct 23, 2019 in Vue by LC Marshal Captain (25,790 points)

You can use the v-model directive to create two-way data bindings on form input, textarea, and select elements. It automatically picks the correct way to update the element based on the input type. (src: Vue.js Documentation)

<span>Multiline message is:</span>
<p style="white-space: pre-line;">{{ message }}</p>
<textarea v-model="message" placeholder="add multiple lines"></textarea>

For live code presentation: go here - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.