How to use the veui/managers/confirm.warn function in veui

To help you get started, we’ve selected a few veui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecomfe / veui / packages / veui / demo / cases / Dialog.vue View on Github external
popupConfirms () {
      confirmManager
        .warn('Do you really want to delete it?', 'Confirm', {
          ok: async () => {
            await wait(1000)

            if (Math.random() < 0.5) {
              this.$toast.error('Not lucky enough :(')
              return false
            }
          }
        })
        .then(ok => {
          this.$alert(`You chose [${ok ? 'ok' : 'cancel'}]`)
        })
    },
    popupToasts (type) {
github ecomfe / veui / packages / veui / demo / cases / Dialog.vue View on Github external
popupConfirms () {
      confirmManager
        .warn('Do you really want to delete it?', 'Confirm', {
          ok: () => {
            return new Promise(resolve => {
              setTimeout(() => {
                resolve()
              }, 1000)
            })
          },
          cancel: () => {
            return new Promise(resolve => {
              setTimeout(() => {
                resolve()
              }, 1000)
            })
          }
        })