组件/Alert 警告
通用组件

Alert 警告

用于展示提示或状态信息

该页面由 AI 迁移生成,请谨慎使用

内容已迁移完成,但仍建议结合源码和人工评审结果使用。

Alert 警告

用于展示提示或状态信息,强调当前状态的可见性。

基础用法

提示类型

信息 / 成功 / 警告 / 错误。

示例即将加载...
<template>
  <TxAlert title="提示" message="检查一下配置项。" type="info" />
  <TxAlert title="成功" message="已保存。" type="success" />
  <TxAlert title="注意" message="有需要处理的内容。" type="warning" />
  <TxAlert title="失败" message="保存失败。" type="error" />
</template>

交互契约

Alert 会渲染 role="alert",语义图标统一走共享 TxIcon 渲染器,并且只在点击关闭按钮时触发 close。需要常驻提示时设置 closable=false;需要纯文本提示时设置 showIcon=false

API(Lite)

属性名类型默认值说明
typeinfosuccesswarningerror类型
title标题
message描述信息
closable是否可关闭
showIcon是否显示图标