Skip to content

Message 全局提示 ​

函数式轻量全局反馈通知,使用统一通知区域承载(支持 popover="manual" 顶层渐进增强与 aria-live 播报),悬停或聚焦时自动暂停关闭倒计时。

基础用法 ​

ts
import { VbMessage } from '@vobo-design/ui'

VbMessage.success('保存成功')
const handler = VbMessage.loading({ content: '处理中...', duration: 0 })
handler.close()

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 表示不自动关闭)number3000(loading 默认 0)
closable是否显示关闭按钮booleanfalse
onClose关闭时回调() => void—

基于 MIT 协议开源发布 · @vobo-design/ui v0.5.0