Open a Vuetify dialog from a component template in VueJS

前端 未结 8 1437
故里飘歌
故里飘歌 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:50

    I prefer use this:

    DialogConfirm.vue

    
    
    

    Usage Example

    /** Disable AP Mode */
      setApMode(enable: boolean) {
        const action = () => {
          Api.get('wifi', {
            params: {
              ap: enable
            }
          }).then(response => this.$store.dispatch('status'))
        }
        if (enable == true) {
          // No confirmation
          return action();
        }
        this.dialogTitle = 'Are you sure?'
        this.dialogMessage = "you may lost connection to this device.";
        this.dialogActions = [
          {
            label: 'Cancel',
            color: 'success'
          },
          'spacer',
          {
            label: "OK, Disable it",
            color: "error",
            action
          }
        ]
      }
    
    

提交回复
热议问题