From ebbd788fbb2c0b45d4473798efc57eec8ba74a25 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 18 六月 2024 14:51:16 +0800 Subject: [PATCH] 版本更新至2.11.5 --- src/views/form-design/typings/v-form-component.ts | 39 ++++++++++++++++++--------------------- 1 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/views/form-design/typings/v-form-component.ts b/src/views/form-design/typings/v-form-component.ts index fb6e751..b5dce99 100644 --- a/src/views/form-design/typings/v-form-component.ts +++ b/src/views/form-design/typings/v-form-component.ts @@ -2,14 +2,14 @@ // import { ComponentOptions } from 'vue/types/options'; import { ComponentOptions } from 'vue'; import { IVFormMethods } from '../hooks/useVFormMethods'; -import { ColEx } from '/@/components/Form/src/types'; +import { ColEx } from '@/components/Form/src/types'; import { SelectValue } from 'ant-design-vue/lib/select'; import { validateOptions } from 'ant-design-vue/lib/form/useForm'; import { RuleError } from 'ant-design-vue/lib/form/interface'; -import { FormItem } from '/@/components/Form'; +import { FormItem } from '@/components/Form'; +import { FormLayout, FormProps } from 'ant-design-vue/lib/form/Form'; -type LayoutType = 'horizontal' | 'vertical' | 'inline'; type labelLayout = 'flex' | 'Grid'; export type PropsTabKey = 1 | 2 | 3; type ColSpanType = number | string; @@ -75,28 +75,25 @@ /** * 琛ㄥ崟閰嶇疆 */ -export interface IFormConfig { - // 琛ㄥ崟椤归厤缃垪琛� - // schemas: IVFormComponent[]; - // 琛ㄥ崟閰嶇疆 - // config: { - layout?: LayoutType; +export type PickAntFormConfig = Pick< + FormProps, + | 'layout' + | 'size' + | 'colon' + | 'labelAlign' + | 'disabled' + | 'labelCol' + | 'wrapperCol' + | 'hideRequiredMark' +>; + +// 浣跨敤extends 鑰屼笉浣跨敤 &鑱旂粨 鏄负浜嗛伩鍏� type:check鎸囦护绫诲瀷閲嶈浇閿欒 +export interface IFormConfig extends PickAntFormConfig { labelLayout?: labelLayout; labelWidth?: number; - labelCol?: Partial<IACol>; - wrapperCol?: Partial<IACol>; - hideRequiredMark?: boolean; - // Whether to disable schemas: IVFormComponent[]; - disabled?: boolean; - labelAlign?: 'left' | 'right'; - // Internal component size of the form - size?: 'default' | 'small' | 'large'; - // }; - // 褰撳墠閫変腑椤� currentItem?: IVFormComponent; activeKey?: PropsTabKey; - colon?: boolean; } export interface AForm { @@ -118,7 +115,7 @@ * @default 'horizontal' * @type string */ - layout: 'horizontal' | 'inline' | 'vertical'; + layout: FormLayout; /** * The layout for input controls, same as labelCol -- Gitblit v1.9.3