Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh

We all know that v-model is used for two-way binding. We mostly use it with form elements. Sometimes, we even use it with custom components.

Vue-2 allowed the use of only one v-model on a component. In Vue-3, we can bind any number of v-models to our custom components:

   <survey-form v-model:name="name" v-model:age="age"> </survey-form>


        <label>Name: </label>
        <input :value="name" @input="updateName($" />
        <label>Age: </label>
        <input :value="age" @input="updateAge($" />
    export default {
      props: {
        name: String,
        age: Number
      setup(props, { emit }) {
        const updateName = value => {
          emit('update:name', value)
        const updateAge = value => {
          emit('update:age', +value)
        return { updateName, updateAge }


Add new comment

Restricted HTML


Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.


Contact Us

All the content is FREE but I still need your help


Become a patreon