diff --git a/packages/reactivity/src/reactive.ts b/packages/reactivity/src/reactive.ts index 7d9c33aa4d0..729c854965e 100644 --- a/packages/reactivity/src/reactive.ts +++ b/packages/reactivity/src/reactive.ts @@ -167,7 +167,7 @@ export type DeepReadonly = T extends Builtin ? WeakSet> : T extends Promise ? Promise> - : T extends Ref + : T extends Ref ? Readonly>> : T extends {} ? { readonly [K in keyof T]: DeepReadonly } diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 43b26b78f9d..6b8d541819d 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -489,12 +489,12 @@ export type ShallowUnwrapRef = { [K in keyof T]: DistributeRef } -type DistributeRef = T extends Ref ? V : T +type DistributeRef = T extends Ref ? V : T export type UnwrapRef = - T extends ShallowRef + T extends ShallowRef ? V - : T extends Ref + : T extends Ref ? UnwrapRefSimple : UnwrapRefSimple