# Alert 警告
用于页面中展示重要的提示信息。
# 基本用法
页面中的非浮层元素,不会自动消失。
成功提示的文案
消息提示的文案
警告提示的文案
错误提示的文案
复制代码
# 主题
Alert 组件提供了两个不同的主题:light
和dark
。
成功提示的文案
消息提示的文案
警告提示的文案
错误提示的文案
复制代码
# 自定义关闭按钮
自定义关闭按钮为文字或其他符号。
不可关闭的 alert
自定义 close-text知道了
设置了回调的 alert
复制代码
# 带有 icon
表示某种状态时提升可读性。
成功提示的文案
消息提示的文案
警告提示的文案
错误提示的文案
复制代码
# 文字居中
使用 center
属性让文字水平居中。
成功提示的文案
消息提示的文案
警告提示的文案
错误提示的文案
复制代码
# 带有辅助性文字介绍
包含标题和内容,解释更详细的警告。
带辅助性文字介绍
这是一句绕口令:黑灰化肥会挥发发灰黑化肥挥发;灰黑化肥会挥发发黑灰化肥发挥。 黑灰化肥会挥发发灰黑化肥黑灰挥发化为灰……
复制代码
# 带有 icon 和辅助性文字介绍
成功提示的文案
文字说明文字说明文字说明文字说明文字说明文字说明
消息提示的文案
文字说明文字说明文字说明文字说明文字说明文字说明
警告提示的文案
文字说明文字说明文字说明文字说明文字说明文字说明
错误提示的文案
文字说明文字说明文字说明文字说明文字说明文字说明
复制代码
# Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
title | 标题 | string | — | — |
type | 主题 | string | success/warning/info/error | info |
description | 辅助性文字。也可通过默认 slot 传入 | string | — | — |
closable | 是否可关闭 | boolean | — | true |
center | 文字是否居中 | boolean | — | true |
close-text | 关闭按钮自定义文本 | string | — | — |
show-icon | 是否显示图标 | boolean | — | false |
effect | 选择提供的主题 | string | light/dark | light |
# Slot
Name | Description |
---|---|
— | 描述 |
title | 标题的内容 |
# Events
事件名称 | 说明 | 回调参数 |
---|---|---|
close | 关闭alert时触发的事件 | — |
← Tree 树形控件 Loading 加载 →