Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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)
})
}
})