仅桌面端保证样式
Notify 通知提醒
角落通知:系统级消息、异步任务结果的轻量提醒,自动消失、可手动关闭。与 Message 的分工——Message 居中打断感更强,Notify 落在角落适合结果类通知。
基础用法
对象式传 title + message;四个快捷方法覆盖常用类型:
不自动关闭与关闭回调
duration: 0 表示常驻,只能手动关闭;onClose 在通知消失时回调:
位置
position 支持四角(默认 top-right):
Notify Options
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| title | 通知标题 | string | |
| message | 通知内容 | string | |
| type | 类型,决定图标与配色 | info | success | warning | error | info |
| duration | 显示时长(毫秒),0 表示不自动关闭 | number | 4500 |
| showClose | 显示关闭按钮 | boolean | true |
| position | 停靠位置(四角) | top-right | top-left | bottom-right | bottom-left | top-right |
| onClose | 关闭回调(自动到期或手动关闭均触发) | () => void | — |
快捷方法
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| $notify.success / info / warning / error | (title, message?, options?) 按类型快捷调用 | (title, message, options) => void | — |