feat(sfc): support $shallowRef ref sugar

This commit is contained in:
Evan You
2021-08-11 10:19:58 -04:00
parent e42d7794cb
commit 00b76d3dc1
7 changed files with 46 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
import {
expectType,
$ref,
$shallowRef,
$computed,
$fromRefs,
$raw,
@@ -14,6 +15,10 @@ expectType<number>($ref(1))
expectType<number>($ref(ref(1)))
expectType<{ foo: number }>($ref({ foo: ref(1) }))
// $shallowRef
expectType<number>($shallowRef(1))
expectType<{ foo: Ref<number> }>($shallowRef({ foo: ref(1) }))
// $computed
expectType<number>($computed(() => 1))
let b = $ref(1)