diff --git a/src/hooks/component/useFormItem.ts b/src/hooks/component/useFormItem.ts index fe4723b..296dd6a 100644 --- a/src/hooks/component/useFormItem.ts +++ b/src/hooks/component/useFormItem.ts @@ -1,4 +1,4 @@ -import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue' +import { UnwrapRef, Ref, WritableComputedRef, DeepReadonly, nextTick } from 'vue' import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw } from 'vue' import { isEqual } from 'lodash-es' @@ -36,7 +36,7 @@ export function useRuleFormItem(props: T, key: keyof T = ' if (isEqual(value, defaultState.value)) return innerState.value = value as T[keyof T] - setTimeout(() => { + nextTick(() => { emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])) }) }