fix(toRef): ref created from union typed prop can't be used in watch (#3048)
This commit is contained in:
@@ -20,7 +20,7 @@ export interface Ref<T = any> {
|
||||
_shallow?: boolean
|
||||
}
|
||||
|
||||
export type ToRef<T> = T extends Ref ? T : Ref<UnwrapRef<T>>
|
||||
export type ToRef<T> = [T] extends [Ref] ? T : Ref<UnwrapRef<T>>
|
||||
export type ToRefs<T = any> = {
|
||||
// #2687: somehow using ToRef<T[K]> here turns the resulting type into
|
||||
// a union of multiple Ref<*> types instead of a single Ref<* | *> type.
|
||||
|
||||
Reference in New Issue
Block a user