mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
627 B
627 B
Async
Confirm can be async.
<n-button @click="handleClick">
Success
</n-button>
.n-button {
margin: 0 12px 8px 0;
}
export default {
methods: {
handleClick(e) {
const confirmInstance = this.$NConfirm.success({
title: 'Async',
content:
'Click and count down 3 second',
positiveText: 'Confirm',
onPositiveClick: () => {
confirmInstance.loading = true
this.$NMessage.success('Count down 3 second')
return new Promise(resolve => window.setTimeout(() => resolve(true), 3000))
}
})
}
}
}