|
|
@@ -16,7 +16,20 @@ interface DialogState {
|
|
|
}
|
|
|
|
|
|
interface DialogModel extends DialogState {
|
|
|
+ /** 打开弹窗
|
|
|
+ * @param props 弹窗配置,字段说明:
|
|
|
+ * - title: 弹窗标题(React.ReactNode)
|
|
|
+ * - content: 弹窗主体内容(React.ReactNode)
|
|
|
+ * - icon: 可选,标题前图标(string 或 IconifyIcon)
|
|
|
+ * - buttons: 可选,底部按钮列表,每项为 { label, onClick?(event, dialogId), variant?: 'primary'|'secondary' }
|
|
|
+ * - maskClosable: 可选,点击遮罩是否关闭,默认 true
|
|
|
+ * @returns 该弹窗的唯一 id,用于 closeDialog
|
|
|
+ */
|
|
|
openDialog: (props: Omit<DialogProps, 'open' | 'id' | 'zIndex'>) => string;
|
|
|
+ /** 关闭指定弹窗
|
|
|
+ * @param id openDialog 返回的弹窗 id
|
|
|
+ * @returns void
|
|
|
+ */
|
|
|
closeDialog: (id: string) => void;
|
|
|
}
|
|
|
|