Skip to content

消息提示 Message

基本用法

内容可以是 VNode

可以手动关闭

文本居中

可以传入 HTML 片段

可通过 onClose 事件来阻止关闭

API

Message Props

参数名说明类型可选值默认值
duration持续时间(ms)number3000
type消息框的类型stringsuccess / warning / info / dangerinfo
message消息内容string
icon自定义图标string
dangerouslyUseHTMLString是否把 message 作为 HTML 渲染booleanfalse
customClass自定义消息框的类名string
showClose是否显示关闭按钮booleantrue
center弹窗框内的文本是否居中booleanfalse
offset弹窗框距离窗口顶部的距离number20
closeOnHover鼠标移到消息框上时,是否依然要关闭booleanfalse
onClose关闭时触发的事件,返回 Promise<true> 或者 true 时消息框永远不会关闭function