Message 全局提示
函数式轻量全局反馈通知,使用统一通知区域承载(支持 popover="manual" 顶层渐进增强与 aria-live 播报),悬停或聚焦时自动暂停关闭倒计时。
基础用法
ts
import { VbMessage } from '@vobo-design/ui'
VbMessage.success('保存成功')
const handler = VbMessage.loading({ content: '处理中...', duration: 0 })
handler.close()1
2
3
4
5
2
3
4
5
API
静态方法
VbMessage(options)/VbMessage.info(...)/VbMessage.success(...)/VbMessage.warning(...)/VbMessage.error(...)/VbMessage.loading(...)VbMessage.closeAll():清空当前所有通知
Options
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
content | 提示文案 | string | — |
type | 语义类型 | 'info' | 'success' | 'warning' | 'error' | 'loading' | 'info' |
duration | 自动关闭时长(ms,0 表示不自动关闭) | number | 3000(loading 默认 0) |
closable | 是否显示关闭按钮 | boolean | false |
onClose | 关闭时回调 | () => void | — |