mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
550 B
550 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',
onPositiveClick: hide => {
confirmInstance.loading = true
this.$NMessage.success('Count down 3 second')
window.setTimeout(hide, 3000)
}
})
}
}
}