mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
docs: update demo to catch errors, close: #2912
This commit is contained in:
parent
9777c7d065
commit
25cb3e2d30
@ -23,9 +23,9 @@ function showConfirm() {
|
||||
title: 'Are you sure you want to delete this item ?',
|
||||
content: 'When clicked the OK button, this dialog will be closed after 1 second',
|
||||
onOk() {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, 1000);
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(Math.random() > 0.5 ? resolve : reject, 1000);
|
||||
}).catch(() => console.log('Oops errors!'));
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user