Commit a0165d1eeed07ac2a4ccf0f62ea2b93e2a478e14
Committed by
GitHub
1 parent
84473311
perf(useRuleFormItem): more accurate return type (#1290)
Showing
1 changed file
with
8 additions
and
1 deletions
src/hooks/component/useFormItem.ts
1 | -import type { UnwrapRef, Ref } from 'vue'; | |
1 | +import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue'; | |
2 | 2 | import { |
3 | 3 | reactive, |
4 | 4 | readonly, |
... | ... | @@ -12,6 +12,13 @@ import { |
12 | 12 | |
13 | 13 | import { isEqual } from 'lodash-es'; |
14 | 14 | |
15 | +export function useRuleFormItem<T extends Recordable, K extends keyof T, V = UnwrapRef<T[K]>>( | |
16 | + props: T, | |
17 | + key?: K, | |
18 | + changeEvent?, | |
19 | + emitData?: Ref<any[]>, | |
20 | +): [WritableComputedRef<V>, (val: V) => void, DeepReadonly<V>]; | |
21 | + | |
15 | 22 | export function useRuleFormItem<T extends Recordable>( |
16 | 23 | props: T, |
17 | 24 | key: keyof T = 'value', | ... | ... |