Commit 6b594aec5397cda80c57305ce203bce17929fc0c

Authored by lzdjack
Committed by GitHub
1 parent fa33c6b0

fix: Fix the issue that clear verification does not take effect in the reset form (#1498)

src/components/Form/src/hooks/useFormEvents.ts
1 1 import type { ComputedRef, Ref } from 'vue';
2 2 import type { FormProps, FormSchema, FormActionType } from '../types/form';
3 3 import type { NamePath } from 'ant-design-vue/lib/form/interface';
4   -import { unref, toRaw } from 'vue';
  4 +import { unref, toRaw, nextTick } from 'vue';
5 5 import { isArray, isFunction, isObject, isString } from '/@/utils/is';
6 6 import { deepMerge } from '/@/utils';
7 7 import { dateItemType, handleInputNumberValue } from '../helper';
... ... @@ -39,7 +39,8 @@ export function useFormEvents({
39 39 Object.keys(formModel).forEach((key) => {
40 40 formModel[key] = defaultValueRef.value[key];
41 41 });
42   - clearValidate();
  42 + nextTick(() => clearValidate());
  43 +
43 44 emit('reset', toRaw(formModel));
44 45 submitOnReset && handleSubmit();
45 46 }
... ...