docs: fix alert demo in docs
parent
e0cfe4a4b1
commit
5390070880
|
@ -20,8 +20,11 @@ function showIconConfirm() {
|
||||||
|
|
||||||
function showAsyncConfirm() {
|
function showAsyncConfirm() {
|
||||||
confirm({
|
confirm({
|
||||||
beforeClose() {
|
beforeClose({ isConfirm }) {
|
||||||
|
if (isConfirm) {
|
||||||
|
// 这里可以执行一些异步操作。如果最终返回了false,将阻止关闭弹窗
|
||||||
return new Promise((resolve) => setTimeout(resolve, 2000));
|
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