Skip to content

Commit

Permalink
docs(Dialog): add demo of async close confirm dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Javey committed May 11, 2024
1 parent be52096 commit 67201af
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions components/dialog/demos/static.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import {Button, ButtonGroup} from 'kpc';
ev-click={this.showDialogWithTitle.bind(this, $value)}
>Show {$value[0].toUpperCase() + $value.substring(1)} Dialog with Title</Button>
</ButtonGroup>
<br />
<br />
<Button ev-click={this.showAsyncCloseConfirm}>异步关闭confirm弹层</Button>
</div>
```

Expand Down Expand Up @@ -69,5 +73,19 @@ export default class extends Component<Props> {
Message.info('clicked cancel button');
});
}

showAsyncCloseConfirm() {
let dialog: Dialog;
Dialog.confirm({
content: '点击确认,异步关闭',
ref: (_dialog) => dialog = _dialog,
ok: () => {
dialog.showLoading();
setTimeout(() => {
dialog.close();
}, 3000);
},
});
}
}
```

0 comments on commit 67201af

Please sign in to comment.