Commit 45b0be7f7efaf2d67a7a08affcd4f1530dd3b3bc
Committed by
GitHub
1 parent
c999abb2
fix: 修复表单自定义组件验证不通过的bug (#2510)
Showing
1 changed file
with
2 additions
and
11 deletions
src/hooks/component/useFormItem.ts
1 | import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue'; | 1 | import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue'; |
2 | -import { | ||
3 | - reactive, | ||
4 | - readonly, | ||
5 | - computed, | ||
6 | - getCurrentInstance, | ||
7 | - watchEffect, | ||
8 | - unref, | ||
9 | - nextTick, | ||
10 | - toRaw, | ||
11 | -} from 'vue'; | 2 | +import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, toRaw } from 'vue'; |
12 | 3 | ||
13 | import { isEqual } from 'lodash-es'; | 4 | import { isEqual } from 'lodash-es'; |
14 | 5 | ||
@@ -50,7 +41,7 @@ export function useRuleFormItem<T extends Recordable>( | @@ -50,7 +41,7 @@ export function useRuleFormItem<T extends Recordable>( | ||
50 | if (isEqual(value, defaultState.value)) return; | 41 | if (isEqual(value, defaultState.value)) return; |
51 | 42 | ||
52 | innerState.value = value as T[keyof T]; | 43 | innerState.value = value as T[keyof T]; |
53 | - nextTick(() => { | 44 | + setTimeout(() => { |
54 | emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])); | 45 | emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || [])); |
55 | }); | 46 | }); |
56 | }, | 47 | }, |