#header-mark#
Dialog 对话框
在保留当前页面状态的情况下,告知用户并承载相关操作。
WARNING
当前页面只能展示组件的样式,具体交互效果需要在 notebook 使用。
基础用法
Dialog 弹出一个对话框,适合需要定制性更大的场景。
需要设置 v-model 属性,它接收 bool,当为 True 时显示 Dialog。 Dialog 分为两个部分:body 和 footer,footer 需要具名为 footer 的 slot。 title 属性用于定义标题,它是可选的,默认值为空。
TIP
Dialog 需要放在最外层才能正确显示!
打开/关闭对话框事件
API
Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| model-value / v-model | 是否显示 Dialog | boolean | — |
| title | Dialog 对话框 Dialog 的标题 | string | '' |
| width | 对话框的宽度,默认值为 50% | string / number | '' |
Slots
| Name | Description |
|---|---|
| — | Dialog 的内容 |
| footer | Dialog按钮操作区的内容 |
Events
| Name | Description | Type |
|---|---|---|
| open | Dialog 打开的回调 | Function |
| close | Dialog 关闭的回调 | Function |
src/examples/ipywui/component/dialog