Open a Vuetify dialog from a component template in VueJS

前端 未结 8 1428
故里飘歌
故里飘歌 2020-12-02 11:27

I\'m using the VueJS Vuetify framework and I need to open a dialog - that gets imported as a component template - from another template. Once the Menu butto

8条回答
  •  甜味超标
    2020-12-02 11:57

    Simple minimal working example

    codepen

    Pass value prop as value to v-dialog component, and from child dialog emit input event whenever you want to close it:

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

    and add v-model to your parent

    //Parent.vue
    
    

    So no custom event bus, no data, no watch, no computed.

提交回复
热议问题