2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 2
|
2016-07-04 10:44:55 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 修改延时
|
|
|
|
en-US: Customize duration
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-07-11 11:27:10 +08:00
|
|
|
|
2016-07-04 10:44:55 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-09-07 12:32:31 +08:00
|
|
|
自定义时长 `10s`,默认时长为 `1.5s`。
|
2015-07-11 11:27:10 +08:00
|
|
|
|
2016-07-04 10:44:55 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Customize message display duration from default `1.5s` to `10s`.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { message, Button } from 'antd';
|
2015-07-11 11:27:10 +08:00
|
|
|
|
2017-03-19 01:14:44 +08:00
|
|
|
const success = () => {
|
2016-07-04 10:44:55 +08:00
|
|
|
message.success('This is a prompt message for success, and it will disappear in 10 seconds', 10);
|
2015-07-11 18:00:58 +08:00
|
|
|
};
|
2015-07-11 11:27:10 +08:00
|
|
|
|
2017-03-19 01:14:44 +08:00
|
|
|
ReactDOM.render(
|
|
|
|
<Button onClick={success}>Customized display duration</Button>
|
2015-12-29 12:08:58 +08:00
|
|
|
, mountNode);
|
2015-07-11 11:27:10 +08:00
|
|
|
````
|