mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
Update manual.md
After destroying need to clear interval
This commit is contained in:
parent
3b9263f458
commit
ad347a98e2
@ -22,13 +22,16 @@ function countDown() {
|
||||
title: 'This is a notification message',
|
||||
content: `This modal will be destroyed after ${secondsToGo} second.`,
|
||||
});
|
||||
setInterval(() => {
|
||||
const timer = setInterval(() => {
|
||||
secondsToGo -= 1;
|
||||
modal.update({
|
||||
content: `This modal will be destroyed after ${secondsToGo} second.`,
|
||||
});
|
||||
}, 1000);
|
||||
setTimeout(() => modal.destroy(), secondsToGo * 1000);
|
||||
setTimeout(() => {
|
||||
clearInterval(timer);
|
||||
modal.destroy();
|
||||
}, secondsToGo * 1000);
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
|
Loading…
Reference in New Issue
Block a user