perf(useRuleFormItem): more accurate return type (#1290)

This commit is contained in:
pq 2021-10-20 09:13:04 +08:00 committed by GitHub
parent 8447331197
commit a0165d1eee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import type { UnwrapRef, Ref } from 'vue'; import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue';
import { import {
reactive, reactive,
readonly, readonly,
@ -12,6 +12,13 @@ import {
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
export function useRuleFormItem<T extends Recordable, K extends keyof T, V = UnwrapRef<T[K]>>(
props: T,
key?: K,
changeEvent?,
emitData?: Ref<any[]>,
): [WritableComputedRef<V>, (val: V) => void, DeepReadonly<V>];
export function useRuleFormItem<T extends Recordable>( export function useRuleFormItem<T extends Recordable>(
props: T, props: T,
key: keyof T = 'value', key: keyof T = 'value',