docs: fix alert demo in docs
This commit is contained in:
parent
7933da8f66
commit
c623604ea9
@ -20,8 +20,11 @@ function showIconConfirm() {
|
|||||||
|
|
||||||
function showAsyncConfirm() {
|
function showAsyncConfirm() {
|
||||||
confirm({
|
confirm({
|
||||||
beforeClose() {
|
beforeClose({ isConfirm }) {
|
||||||
return new Promise((resolve) => setTimeout(resolve, 2000));
|
if (isConfirm) {
|
||||||
|
// 这里可以执行一些异步操作。如果最终返回了false,将阻止关闭弹窗
|
||||||
|
return new Promise((resolve) => setTimeout(resolve, 2000));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
content: 'This is an alert message with async confirm',
|
content: 'This is an alert message with async confirm',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
|
Loading…
Reference in New Issue
Block a user