From add956528145ebdaf1f65de0b8b8e7c1f74b4ce6 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:01:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vue/src/hooks/component/useFormItem.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/vue/src/hooks/component/useFormItem.ts b/apps/vue/src/hooks/component/useFormItem.ts index f1a9cef63..1296bb14c 100644 --- a/apps/vue/src/hooks/component/useFormItem.ts +++ b/apps/vue/src/hooks/component/useFormItem.ts @@ -1,13 +1,5 @@ import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue'; -import { - reactive, - readonly, - computed, - getCurrentInstance, - watchEffect, - unref, - toRaw, -} from 'vue'; +import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw } from 'vue'; import { isEqual } from 'lodash-es'; @@ -49,7 +41,9 @@ export function useRuleFormItem( if (isEqual(value, defaultState.value)) return; innerState.value = value as T[keyof T]; - emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])); + setTimeout(() => { + emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])); + }); }, });