123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import type { CSSProperties } from 'vue'
- declare global {
- declare type ComponentName =
- | 'Radio'
- | 'RadioButton'
- | 'Checkbox'
- | 'CheckboxButton'
- | 'Input'
- | 'Autocomplete'
- | 'InputNumber'
- | 'Select'
- | 'Cascader'
- | 'Switch'
- | 'Slider'
- | 'TimePicker'
- | 'DatePicker'
- | 'Rate'
- | 'ColorPicker'
- | 'Transfer'
- | 'Divider'
- | 'TimeSelect'
- | 'SelectV2'
- | 'InputPassword'
- | 'Editor'
- declare type ColProps = {
- span?: number
- xs?: number
- sm?: number
- md?: number
- lg?: number
- xl?: number
- tag?: string
- }
- declare type FormValueType = string | number | string[] | number[] | boolean | undefined | null
- declare type FormItemProps = {
- labelWidth?: string | number
- required?: boolean
- rules?: Recordable
- error?: string
- showMessage?: boolean
- inlineMessage?: boolean
- style?: CSSProperties
- }
- declare type ComponentOptions = {
- label?: string
- value?: FormValueType
- disabled?: boolean
- key?: string | number
- children?: ComponentOptions[]
- options?: ComponentOptions[]
- } & Recordable
- declare type ComponentOptionsAlias = {
- labelField?: string
- valueField?: string
- }
- declare type ComponentProps = {
- optionsAlias?: ComponentOptionsAlias
- options?: ComponentOptions[]
- optionsSlot?: boolean
- } & Recordable
- declare type FormSchema = {
- // 唯一值
- field: string
- // 标题
- label?: string
- // col组件属性
- colProps?: ColProps
- // 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档
- componentProps?: { slots?: Recordable } & ComponentProps
- // formItem组件属性
- formItemProps?: FormItemProps
- // 渲染的组件
- component?: ComponentName
- // 初始值
- value?: FormValueType
- // 是否隐藏
- hidden?: boolean
- }
- declare type FormSetPropsType = {
- field: string
- path: string
- value: any
- }
- }
|