|
@@ -1,6 +1,6 @@
|
|
|
import type { ComputedRef, Ref } from 'vue';
|
|
|
import type { FormProps, FormSchema, FormActionType } from '../types/form';
|
|
|
-import type { NamePath, ValidateOptions } from 'ant-design-vue/lib/form/interface';
|
|
|
+import type { NamePath, ValidateOptions } from 'ant-design-vue/lib/form/interface';
|
|
|
import { unref, toRaw } from 'vue';
|
|
|
import { isArray, isFunction, isObject, isString } from '/@/utils/is';
|
|
|
import { deepMerge } from '/@/utils';
|
|
@@ -19,6 +19,10 @@ interface UseFormActionContext {
|
|
|
schemaRef: Ref<FormSchema[]>;
|
|
|
handleFormValues: Fn;
|
|
|
}
|
|
|
+export declare type ValidateFields = (
|
|
|
+ nameList?: NamePath[],
|
|
|
+ options?: ValidateOptions,
|
|
|
+ ) => Promise<void>;
|
|
|
export function useFormEvents({
|
|
|
emit,
|
|
|
getProps,
|
|
@@ -210,9 +214,9 @@ export function useFormEvents({
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- async function validateFields(nameList?: NamePath[] | undefined,options?: ValidateOptions | undefined) {
|
|
|
+ async function validateFields(nameList?: NamePath[], options?: ValidateOptions | undefined) {
|
|
|
return unref(formElRef)?.validateFields(nameList, options);
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
async function validate(nameList?: NamePath[] | undefined) {
|
|
|
return await unref(formElRef)?.validate(nameList);
|