Skip to content

Alert 警告

用于页面中的警告、通知、提示信息展示。

基础用法

通过 type 属性设置不同的警告类型。

带描述的警告

通过 description 属性添加辅助文字说明。

主题与居中

使用 effect 属性切换主题,center 属性居中内容。

自定义关闭按钮

通过 close-text 自定义关闭按钮文字,或通过 closable 控制是否可关闭。

Alert API

Props

参数说明类型默认值
typeAlert 类型'success' | 'warning' | 'info' | 'error''info'
title标题string''
description辅助文字string''
showIcon是否显示图标booleanfalse
center是否居中booleanfalse
closable是否可关闭booleantrue
closeText关闭按钮文字string''
effect主题样式'light' | 'dark''light'

Events

事件名说明回调参数
close关闭 Alert 时触发(event: MouseEvent)

Slots

插槽名说明
default自定义内容

基于 MIT 许可发布