Browse Source

doc: add message onClose callback close #5073

pull/4511/merge
bang 8 years ago
parent
commit
28b1692f1a
  1. 13
      components/message/index.en-US.md
  2. 14
      components/message/index.zh-CN.md

13
components/message/index.en-US.md

@ -14,12 +14,12 @@ Display global messages as feedbacks to user operations.
## API
- `message.success(content, duration)`
- `message.error(content, duration)`
- `message.info(content, duration)`
- `message.warning(content, duration)`
- `message.warn(content, duration)`
- `message.loading(content, duration)`
- `message.success(content, duration, onClose)`
- `message.error(content, duration, onClose)`
- `message.info(content, duration, onClose)`
- `message.warning(content, duration, onClose)`
- `message.warn(content, duration, onClose)`
- `message.loading(content, duration, onClose)`
This components provides 4 static methods, with arguments as following:
@ -27,6 +27,7 @@ This components provides 4 static methods, with arguments as following:
|------------|------------------------------------|--------------------------|--------------|
| content | content of the message | string\|ReactNode | - |
| duration | time before auto-dismiss,in seconds | number | 1.5 |
| onClose | Specify a function that will be called after the message closed| Function | - |
Methods for global configuration and destruction are also provided:

14
components/message/index.zh-CN.md

@ -15,12 +15,12 @@ title: Message
## API
- `message.success(content, duration)`
- `message.error(content, duration)`
- `message.info(content, duration)`
- `message.warning(content, duration)`
- `message.warn(content, duration)`
- `message.loading(content, duration)`
- `message.success(content, duration, onClose)`
- `message.error(content, duration, onClose)`
- `message.info(content, duration, onClose)`
- `message.warning(content, duration, onClose)`
- `message.warn(content, duration, onClose)`
- `message.loading(content, duration, onClose)`
组件提供了四个静态方法,参数如下:
@ -28,6 +28,8 @@ title: Message
|------------|----------------|--------------------------|--------------|
| content | 提示内容 | string\|ReactNode | - |
| duration | 自动关闭的延时,单位秒 | number | 1.5 |
| onClose | 关闭时触发的回调函数 | Function | - |
还提供了全局配置和全局销毁方法:

Loading…
Cancel
Save