UNPKG

cgreact-core

Version:

未发表!CGReact前端Web研发框架核心包

22 lines (19 loc) 1.27 kB
/** 模态框数据类型定义*/ import {CGReactComponent} from "./cgreact-type"; type CGReactModalState = { title?: string, // 标题文字,可以没有,就是无标题的对话框 content?: string | JSX, //内容文字,也可以在标签的子元素中配置 cancel?: string | boolean, // 取消按钮文字(将导致显示取消按钮),配置为true则显示“取消” confirm?: string | boolean, // 确认按钮文字(将导致显示确认按钮),配置为true则显示“确认" onMount?: (modal: CGReactComponent) => void,// 对话框加载到页面的时候回调 onDismiss?: (modal: CGReactComponent) => void,// 对话框消失的时候回调 onCancel?: () => void // 取消按钮事件回调,默认直接关闭对话框 onConfirm?: () => void // 确认按钮事件回调,默认直接关闭对话框 }// 模态框数据定义 export interface ModalState extends CGReactModalState {} /** 模态框参数类型定义*/ type CGReactModalProp = { modal?: CGReactModalState | boolean //模态框参数同步,配置为true则使用默认模态框配置 children?: any //元素可以包裹其他元素 } //参数类型定义 export interface ModalProp extends CGReactModalProp {}