Categories

Jan 9 in Vue.JS
Q:

What is the difference v-bind and v-model? Provide some code example.

1 Answer

Jan 9
v-model is a two-way binding for form inputs. It combines v-bind, which brings a js value into the markup, and v-on:input to update the js value.

Consider:

<input v-model="something">

and it's just syntactic sugar for:

<input

   v-bind:value="something"

   v-on:input="something = $event.target.value"

>

v-model works with all the basic HTML input types (text, textarea, number, radio, checkbox, select). You can use v-model with input type=date if your model stores dates as ISO strings (yyyy-mm-dd).
Click here to read more about Vue JS
Click here to read more about Insurance

Related questions

Madanswer
Oct 9, 2019 in Vue.JS
Oct 7, 2019 in Vue.JS
Oct 21, 2019 in Vue.JS
...