Commit c623604e by Netfan

docs: fix alert demo in docs

1 parent 7933da8f
...@@ -20,8 +20,11 @@ function showIconConfirm() { ...@@ -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',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!