fix(useFormItem): 修复ApiSelect的onChange事件获取不到第二个参数

pull/4/MERGE
xingyuv 2023-04-12 17:36:10 +08:00
parent 23664aa943
commit b2e9da144c
1 changed files with 2 additions and 2 deletions

View File

@ -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 { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw } from 'vue'
import { isEqual } from 'lodash-es' import { isEqual } from 'lodash-es'
@ -36,7 +36,7 @@ export function useRuleFormItem<T extends Recordable>(props: T, key: keyof T = '
if (isEqual(value, defaultState.value)) return if (isEqual(value, defaultState.value)) return
innerState.value = value as T[keyof T] innerState.value = value as T[keyof T]
setTimeout(() => { nextTick(() => {
emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])) emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || []))
}) })
} }