2020-02-04 13:40:10 +08:00
|
|
|
# 信息 Message
|
2020-02-08 13:41:40 +08:00
|
|
|
(一般是)从浏览器顶部降下来的神谕。
|
2020-02-04 13:40:10 +08:00
|
|
|
## 演示
|
|
|
|
```demo
|
|
|
|
basic
|
|
|
|
icon
|
|
|
|
timing
|
|
|
|
modify-content
|
|
|
|
manually-close
|
|
|
|
about-theme
|
|
|
|
```
|
|
|
|
|
|
|
|
## API
|
|
|
|
### $NMessage Methods
|
2020-02-07 23:40:07 +08:00
|
|
|
|名称|类型|说明|
|
2020-02-04 13:40:10 +08:00
|
|
|
|-|-|-|
|
2020-02-05 12:21:18 +08:00
|
|
|
|info|`(content: string, option?: MessageOption) => MessageEnvironment`||
|
|
|
|
|success|`(content: string, option?: MessageOption) => MessageEnvironment`||
|
|
|
|
|warning|`(content: string, option?: MessageOption) => MessageEnvironment`||
|
|
|
|
|error|`(content: string, option?: MessageOption) => MessageEnvironment`||
|
|
|
|
|loading|`(content: string, option?: MessageOption) => MessageEnvironment`||
|
2020-02-04 13:40:10 +08:00
|
|
|
|
|
|
|
### MessageOption Type
|
2020-02-07 23:40:07 +08:00
|
|
|
|名称|类型|说明|
|
2020-02-04 13:40:10 +08:00
|
|
|
|-|-|-|
|
2020-02-29 14:55:52 +08:00
|
|
|
|content|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数|
|
|
|
|
|icon|`string \| (() => VNode)`|可以是 render 函数|
|
2020-02-04 13:40:10 +08:00
|
|
|
|onHide|`function`||
|
|
|
|
|onAfterHide|`function`||
|
|
|
|
|
|
|
|
### MessageEnvironment API
|
|
|
|
#### MessageEnvironment Properties
|
2020-02-07 23:40:07 +08:00
|
|
|
|名称|类型|说明|
|
2020-02-04 13:40:10 +08:00
|
|
|
|-|-|-|
|
2020-02-29 14:55:52 +08:00
|
|
|
|content|`string \| (() => VNode \| Array<VNode>)`|可以是 render 函数n|
|
|
|
|
|icon|`string \| (() => VNode)`|可以是 render 函数|
|
2020-02-04 13:40:10 +08:00
|
|
|
|type|`'info' \| 'success' \| 'warning' \| 'error' \| 'loading'`||
|
|
|
|
|onHide|`function`||
|
|
|
|
|onAfterHide|`function`||
|
|
|
|
|
|
|
|
#### MessageEnvironment Methods
|
2020-02-07 23:40:07 +08:00
|
|
|
|名称|类型|说明|
|
2020-02-04 13:40:10 +08:00
|
|
|
|-|-|-|
|
|
|
|
|hide|`()`||
|