VueJS change v-model variable from child

前端 未结 2 1171
灰色年华
灰色年华 2021-01-21 22:32

I\'m trying to change the v-model of a component by the parent component most I\'m not getting.

In the parent component I have a showProgress v

2条回答
  •  無奈伤痛
    2021-01-21 22:45

    Pass value prop as value to v-dialog component, and re-emit input from v-dialog component:

    //CustomDialog.vue
    
    
    
    ...
    props:['value']
    

    and add v-model to your parent (custom dialog)

    //Parent.vue
    
    

    Example

提交回复
热议问题