UNPKG

cgreact-core

Version:

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

31 lines (28 loc) 1.63 kB
import {FormItem} from "./cgreact-type-form"; import {LayoutState} from "./cgreact-type-layout"; /* Input输入框数据类型定义*/ type CGReactInputState = {//Input的配置 type?: "text" | "number" | "tel" | "password" | "url" | "email", //input的type类型,默认text label?: string | "请输入一个值" | Array<string | "请输入" | "起始值" | "终止值">, //label会作为input的hint渲染,不配置默认"input" value?: string | Array<string>, //input当前数据数据,可能是起止值,可以不配置 multiline?: boolean, //是否多行,多行渲染textArea disable?: boolean, //input是否处于激活状态,默认false formItem?: FormItem //是否有表单item包括,默认false没有包裹 }// inputState数据类型定义 export interface InputState extends CGReactInputState {} /** Input输入框参数类型定义*/ type CGReactInputProp = { data?: CGReactInputState, //使用Input数据类型 layout?: LayoutState, // 布局参数 value?: string,// 输入框的值 };//参数类型 export interface InputProp extends CGReactInputProp, LayoutState, FormItem {} /** 回调接口数据类型,可能在state数据类型中交叉使用*/ export interface InputConfig //renderInput函数回调接口数据类型 { type: "text" | "number" | "tel" | "password" | "url" | "email", // input类型 label: string, // input的label value: string, // input绑定的数据,可能是起止值 multiline: boolean, //是否多行,多行渲染textArea disable: boolean, //input是否处于激活状态,默认false }