Alert 警告提示

Alert 警告提示

何时使用

  • 需要向用户展示警告、错误、成功等提示信息时。
  • 需要页面级或 banner 形式的提示时。

基础用法

<template>
  <Alert title="提示" type="info" description="这是一条信息提示。" />
  <Alert title="成功" type="success" description="操作已完成。" />
  <Alert title="警告" type="warning" description="请注意检查输入。" />
  <Alert title="错误" type="error" description="操作失败,请重试。" />
</template>

导入

import { Alert } from "@reglow/reui";

Props

属性类型默认值说明
type"info" | "success" | "warning" | "error""info"类型
variantAlertVariant"outlined"变体(outlined 描边 / filled 填充)
titlestring-标题(也可用同名插槽)
descriptionstring-辅助说明文字(也可用同名插槽或默认插槽)
showIconbooleanfalse是否显示图标(banner 模式默认 true
bannerbooleanfalse是否用作顶部公告
closablebooleanfalse是否可关闭(触发 close / afterClose
iconclass-自定义图标 class

事件

事件说明
close点击关闭按钮时触发
afterClose关闭动画结束后触发

插槽

名称说明
title标题内容
description辅助说明内容
icon自定义图标
action右侧操作区
closeIcon自定义关闭图标