yariksav / vuetify-dialog

Easy dialogs in Vuetify.js framework
MIT License
195 stars 48 forks source link

How do I send and use the data that I type inside the prompt action? #142

Open ericvipo opened 2 years ago

ericvipo commented 2 years ago

async openConfirmDelete() {

  let res = await this.$dialog.prompt({
    title: '¿Quiere anular el trámite Disposición de Inicio de Diligencias Prelimninares?',
    text: 'Indicar el motivo de anulación',
    persistent: true,
    width: '600',
    actions: {
      false: 'Cancelar',
      true: {
        color: 'warning',
        text: 'Aceptar',
        handle: () => {
          return new Promise((resolve) => {
            setTimeout(() => {
              resolve(res + 'o')
              console.log(res);
            }, 3000)
          })
        }
      }
    }
  })

  if (res)
    this.$dialog.notify.info('Your name is ' + res)

},
yariksav commented 2 years ago

Your handler and Promise are useless here...

...
      true: {
        color: 'warning',
        text: 'Aceptar'
     }
...

  if (res)
    this.$dialog.notify.info('Your name is ' + res)