fix(types): ref value type unwrapping should happen at creation time
This commit is contained in:
@@ -13,6 +13,12 @@ function foo(arg: number | Ref<number>) {
|
||||
|
||||
// ref unwrapping
|
||||
expectType<number>(unref(arg))
|
||||
|
||||
// ref inner type should be unwrapped
|
||||
const nestedRef = ref({
|
||||
foo: ref(1)
|
||||
})
|
||||
expectType<Ref<{ foo: number }>>(nestedRef)
|
||||
}
|
||||
|
||||
foo(1)
|
||||
|
||||
Reference in New Issue
Block a user