显示全局的通知提醒消息
默认为top-right可选择bottom-righttop-leftbottom-left
添加参数titleColor可修改标题颜色,添加messageColor可修改信息颜色
根据showNotice指定关闭一个notice
如果要一次性关闭所有可使用closeAll
带有 icon,常用来显示「成功 success、警告 warning、消息 info、错误 error」类的系统消息
添加参数onClose类型为Function
添加参数onClick类型为Function
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| type | 消息类型,用于显示图标 | string | success / info / warning / error | '' |
| title | 标题 | string | - | 提示 |
| message | 消息正文内容 | string | - | '' |
| duration | 持续时间 | number | - | 3000(ms) |
| position | 位置 | string | top-right/top-left/bottom-right/bottom-left | top-right |
| titleColor | 标题颜色 | string | - | - |
| messageColor | 信息颜色 | string | - | - |
| toast | 是否居中显示 只展示message内容 | boolean | true/false | false |
| 事件名称 | 说明 | 回调参数 |
|---|---|---|
| close | 关闭的回调 | 示例ID |
| closeAll | 关闭所有 | - |
| onClick | 点击关闭触发 | '' |