Skip to content

FxAlert 警告提示

用于页面中展示重要的提示信息。不依赖任何 UI 框架,颜色走 @fx/styles--color-* token。

基础用法

type 控制语义色,show-icon 显示对应图标。

主题

effect 切换 light(浅色底)/ dark(实色底)。

自定义关闭按钮

closable 控制是否可关闭;close-text 自定义关闭按钮文字。

图标

show-icon 显示默认 type 图标;icon 插槽自定义。

居中

center 使内容居中。

带描述文字

description prop 或默认插槽补充描述;title 插槽自定义标题。

带图标和描述

有描述时图标自动放大、标题字号加大以匹配。

API

Attributes

属性说明类型默认值
title标题string''
description描述性文字string''
type类型'primary' | 'success' | 'info' | 'warning' | 'error'info
closable是否可关闭booleantrue
close-text关闭按钮文字(替换 x)string''
show-icon是否显示图标booleanfalse
center内容是否居中booleanfalse
effect主题'light' | 'dark'light

Slots

插槽名说明
default描述内容(覆盖 description)
title标题内容(覆盖 title)
icon自定义图标(覆盖默认 type 图标)

Events

事件名说明类型
close关闭时触发(evt: MouseEvent) => void