From b2e9da144c9f02bac741be983b7b4465831e0f59 Mon Sep 17 00:00:00 2001 From: xingyuv Date: Wed, 12 Apr 2023 17:36:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(useFormItem):=20=E4=BF=AE=E5=A4=8DApiSelect?= =?UTF-8?q?=E7=9A=84onChange=E4=BA=8B=E4=BB=B6=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=AC=AC=E4=BA=8C=E4=B8=AA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/component/useFormItem.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) || [])) }) }