Toast 轻提示

轻量级消息提示组件,支持多种状态和位置

轻量级消息提示组件,支持多种状态和位置

演示

9:41

代码示例

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

<!-- 事件日志 -->
  <re-toast :key="current" :visible="visible" :message="currentConfig.message" :theme="currentConfig.theme" :placement="currentConfig.placement" :icon="currentConfig.icon" :closeBtn="currentConfig.closeBtn" :direction="currentConfig.direction" @update:visible="onUpdateVisible" />

引入

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

API

Toast Props

名称类型默认值描述必传
visiblebooleanfalse是否显示N
messagestring""提示内容N
themestring"default"提示类型N
directionstring"row"排列方向N
placementstring"middle"显示位置N
durationnumber2000显示时长(ms),0为不自动关闭N
iconstring""自定义图标N
closeBtnbooleanfalse是否显示关闭按钮N
overlaybooleanfalse是否显示遮罩层N
zIndexnumber1000层级N
customStylestring""自定义样式N

Toast Events

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

Toast Slots

名称描述
--