UNPKG

1.12 kBMarkdownView Raw
1## Message 消息
2
3全局展示操作反馈信息。
4
5## 代码演示
6
7### API
8
9#### 函数api
10
11```
12//设置默认设置
13Message.config({
14 top: 20, //顶上显示时距顶部的位置
15 bottom: 20, //左下右下显示时距底部的位置
16 defaultBottom: 20, //底部显示时距底部的位置
17 duration: 20, //显示持续时间
18 width: 500 //左下左上右下右上显示时的宽度
19 });
20
21//销毁所有消息
22Message.destroy();
23
24//创建消息
25Messsage.create({});
26
27```
28
29#### message函数参数
30
31|参数|说明|类型|默认值|
32|:---|:-----|:----|:------|
33|content|内容|string/number|-|
34|duration|显示时间|number|3|
35|color|颜色|dark/light/success/danger/warning/info/successlight/dangerlight/warninglight/infolight|'dark'|
36|onClose|关闭时的钩子函数|function|-|
37|position|位置|top/bottom/topRight/topLeft/bottomRight/bottomLeft|top|
38|style|样式|object|{}|
39|keyboard|esc触发关闭|boolean|true|
40|onEscapeKeyUp|响应ESC键时的钩子函数|function|-|
41|showIcon|是否显示icon|boolean|false|
42
43#### 已支持的键盘操作
44
45|按键|功能|
46|:---|:----|
47|esc |关闭message|