ant-design/components/message/demo/loading.md

29 lines
524 B
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 3
2016-07-04 10:44:55 +08:00
title:
zh-CN: 加载中
en-US: Message of loading
2016-03-31 09:40:55 +08:00
---
2015-09-07 12:27:09 +08:00
2016-07-04 10:44:55 +08:00
## zh-CN
2015-09-07 12:27:09 +08:00
进行全局 loading异步自行移除。
2016-07-04 10:44:55 +08:00
## en-US
Display a global loading indicator, which is dismissed by itself asynchronously.
2017-02-13 10:55:53 +08:00
````jsx
import { message, Button } from 'antd';
2015-09-07 12:27:09 +08:00
2016-07-21 18:05:15 +08:00
const success = () => {
2016-07-21 21:19:37 +08:00
const hide = message.loading('Action in progress..', 0);
2016-07-04 10:44:55 +08:00
// Dismiss manually and asynchronously
2015-09-07 12:27:09 +08:00
setTimeout(hide, 2500);
};
2017-03-19 01:14:44 +08:00
ReactDOM.render(
<Button onClick={success}>Display a loading indicator</Button>
, mountNode);
2015-09-07 12:27:09 +08:00
````