Message 消息通知

用于全局展示通知提醒信息,支持多种主题

用于全局展示通知提醒信息,支持多种主题

演示

9:41

代码示例

<!-- 操作 -->
  <re-button theme="primary" @click="visible = true">显示消息</re-button>

<!-- 事件日志 -->
  <re-message :key="current" :visible="visible" :content="currentConfig.content" :theme="currentConfig.theme" :closeBtn="currentConfig.closeBtn" :zindex="currentConfig.zindex" :offset="currentConfig.offset" @update:visible="onVisibleUpdate" />

引入

推荐使用 easycom 模式,配置后无需手动 import 即可直接使用 <re-message />。

API

Message Props

名称类型默认值描述必传
visiblebooleanfalse是否显示消息通知N
contentstring""消息内容N
themestring"info"消息主题,info/success/warning/errorN
durationnumber3000显示时长,单位毫秒,0表示不自动关闭N
offsetArray<number>0, 16相对屏幕偏移量 x, yN
zindexnumber5000元素层级N
closeBtnbooleanfalse是否显示关闭按钮N
customStylestring""自定义样式N

Message Events

名称参数描述
update:visiblevalue: boolean显隐变化时触发
close-关闭时触发
click-点击时触发

Message Slots

名称描述
--

MessageItem Props

名称类型默认值描述必传
contentstring""消息内容N
themestring"info"消息主题N