Message 消息提示
基础用法
从顶部出现,3 秒后自动消失。 显示代码
不同状态
用来显示「成功、警告、消息、错误」类的操作反馈。 显示代码
文字居中
使用 center 属性让文字水平居中。 显示代码
使用 HTML 片段
message 属性支持传入 HTML 片段 显示代码
Options
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| message | 消息文字 | string / VNode | ---- | ---- |
| type | 主题 | string | success/warning/info/error | info |
| iconClass | 自定义图标的类名,会覆盖 type | string | ---- | ---- |
| dangerouslyUseHTMLString | 是否将 message 属性作为 HTML 片段处理 | boolean | ---- | false |
| customClass | 自定义类名 | string | ---- | ---- |
| duration | 显示时间, 毫秒。设为 0 则不会自动关闭 | number | ---- | 3000 |
| showClose | 是否显示关闭按钮 | boolean | ---- | false |
| center | 文字是否居中 | boolean | ---- | false |
| onClose | 关闭时的回调函数, 参数为被关闭的 message 实例 | function | ---- | ---- |
| offset | Message 距离窗口顶部的偏移量 | number | ---- | 20 |
方法
| 事件名称 | 说明 | 回调参数 |
| close | 关闭当前的 Notification | ---- |