DialogV2 对话框 
弹出对话框,只需关心弹窗内容
基础用法 
triggerProps对象类型是Partial<ButtonProps> & {triggerText?: string }, 所以ElButton组件的所有属性都可以使用
使用triggerProps对象的triggerText属性来快速设置触发器按钮的文案
取消、确定 
cancelProps对象类型是Partial<ButtonProps> & {hidden?: boolean; cancelText?: string}
sureProps对象类型是Partial<ButtonProps> & {hidden?: boolean; sureText?: string}
使用这 2 个属性可以快速设置取消和确定按钮的文案及样式
按钮回调 
onSure和onCancel回调函数的参数含有close方法,用户可自行根据业务选择性调用
如果不设置这 2 个函数,点击后默认自动关闭弹窗
自定义触发器 
有时需要完全自定义触发器 UI,这时紧靠triggerProps设置ElButton组件肯定满足不了,可以使用trigger插槽来自定义
自定义的 ui 点击后默认冒泡,所以用户不必手动调用关闭弹窗的方法
自定义头部 
可以使用header插槽来自定义头部
该使用姿势和ELDialog一致
自定义底部 
可以使用footer插槽来自定义底部
该使用姿势和ELDialog一致
API 
属性 
弹窗其他相关的 API 属性,请参考 ElDialog 即可,剩下是 DialogV2 组件独有的 API 属性
| 属性名 | 说明 | 类型 | 默认值 | 
|---|---|---|---|
| trigger-props | 触发按钮属性设置 | Object | - | 
| cancel-props | 取消按钮属性设置 | Object | - | 
| sure-props | 确定按钮属性设置 | Object | - | 
| on-cancel | 点击取消时的回调 | Function | - | 
| on-sure | 点击确定时的回调 | Function | - | 
Slots 
| 事件名 | 说明 | 
|---|---|
| default | 对话框的默认内容 | 
| header | 对话框标题的内容 | 
| footer | 对话框底部的内容 | 
| trigger | 触发器插槽内容 | 
Exposes 
| 名称 | 详情 | 类型 | 
|---|---|---|
| open | 打开弹窗 | Function | 
| close | 关闭弹窗 | Function |