Skip to content

Dialog 对话框

对话框组件用于在不离开当前页面的情况下与用户进行交互。

基础用法

基础的对话框,用于展示内容和收集用户输入。

Basic Dialog

Click the buttons below to open dialogs with different types

API

属性

属性名说明类型默认值
type对话框类型'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default''default'
width对话框宽度string | number400
open控制对话框是否打开booleanundefined
defaultOpen对话框默认是否打开booleanundefined
modal是否为模态对话框booleantrue
title对话框标题(也可通过 slot 设置)stringundefined

事件

事件名说明类型
update:open当对话框的打开状态变化时触发(value: boolean) => void
openChange当对话框的打开状态变化时触发(value: boolean) => void

插槽

插槽名说明
trigger用于触发对话框打开的元素
title对话框标题(优先级高于 title 属性)
description对话框描述
default对话框内容
footer对话框底部操作按钮区域

Released under the MIT License.