From 2407b3368c3fc5128bbfced98a1d2c70fa3e02e0 Mon Sep 17 00:00:00 2001 From: vben <anncwb@126.com> Date: 星期六, 31 十月 2020 00:15:14 +0800 Subject: [PATCH] fix: some error --- src/components/Form/src/types/form.ts | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Form/src/types/form.ts b/src/components/Form/src/types/form.ts index 5fab498..1ad73d4 100644 --- a/src/components/Form/src/types/form.ts +++ b/src/components/Form/src/types/form.ts @@ -1,4 +1,4 @@ -import type { Form, NamePath, ValidationRule } from 'ant-design-vue/types/form/form'; +import type { NamePath, RuleObject } from 'ant-design-vue/lib/form/interface'; import type { VNode } from 'vue'; import type { BasicButtonProps } from '/@/components/Button/types'; import type { FormItem } from './formItem'; @@ -17,7 +17,7 @@ text?: string; } -export interface FormActionType extends Form { +export interface FormActionType { submit: () => Promise<void>; setFieldsValue: <T>(values: T) => void; resetFields: () => Promise<any>; @@ -29,6 +29,7 @@ appendSchemaByField: (schema: FormSchema, prefixField?: string) => void; validateFields: (nameList?: NamePath[]) => Promise<any>; validate: (nameList?: NamePath[]) => Promise<any>; + scrollToField: (name: NamePath, options?: ScrollOptions) => void; } export type RegisterFn = (formInstance: FormActionType) => void; @@ -113,7 +114,7 @@ componentProps?: any; // 鏍¢獙瑙勫垯 - rules?: ValidationRule[]; + rules?: RuleObject[]; // 鏍¢獙淇℃伅鏄惁鍔犲叆label rulesMessageJoinLabel?: boolean; @@ -150,7 +151,7 @@ dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean); - dynamicRules?: (renderCallbackParams: RenderCallbackParams) => ValidationRule[]; + dynamicRules?: (renderCallbackParams: RenderCallbackParams) => RuleObject[]; } export interface HelpComponentProps { maxWidth: string; -- Gitblit v1.8.0