Skip to content

Message 消息

常用的消息通知。 悬停在消息上时消息不会消失,移出后在指定时间内消失,还可通过ESC销毁全部消息,显示消息时会自动计算之前消息的位置,保证消息不会重叠遮挡。 可以设置消息样式、消失时间、是否能够手动关闭、间距、id、zIndex等

基础用法

使用 type 来定义按钮的样式。 使用 duration 来控制消息消失时间。

loading

通过实例手动关闭

使用消息实例中的 Destroy 方法手动销毁信息。

loading

设置消息是否能够点击关闭

使用 showClose 来设置按钮是否可以通过点击关闭。

loading

Message Attributes

NameDescriptionTypeDefault
type消息类型enum - 'success'| 'warning'| 'danger'| 'info'
message消息内文本string
showClose消失是否可以点击关闭booleantrue
offset消息间距number0

Message Instance

Method/PropDescriptionTypeDefault
id消息idstring前消息id+1
vnode消息内部虚拟节点VNode
props消息参数MessageProps
vm消息实例ComponentInternalInstance
destroy消息销毁方法string