瀏覽代碼

types: simplify ref type

Evan You 6 年之前
父節點
當前提交
6a22ad2fb2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/reactivity/src/ref.ts

+ 1 - 1
packages/reactivity/src/ref.ts

@@ -9,7 +9,7 @@ export interface Ref<T> {
   value: UnwrapNestedRefs<T>
 }
 
-export type UnwrapNestedRefs<T> = T extends Ref<infer V> ? Ref<V> : UnwrapRef<T>
+export type UnwrapNestedRefs<T> = T extends Ref<any> ? T : UnwrapRef<T>
 
 const convert = (val: any): any => (isObject(val) ? reactive(val) : val)