feat(sfc): support $shallowRef ref sugar
This commit is contained in:
@@ -3,6 +3,10 @@ import { Ref, UnwrapRef, ShallowUnwrapRef, ComputedRef } from '@vue/reactivity'
|
||||
export function $ref<T>(arg: T | Ref<T>): UnwrapRef<T>
|
||||
export function $ref() {}
|
||||
|
||||
export function $shallowRef<T>(arg: T): T {
|
||||
return arg
|
||||
}
|
||||
|
||||
declare const ComputedRefMarker: unique symbol
|
||||
type ComputedRefValue<T> = T & { [ComputedRefMarker]?: any }
|
||||
|
||||
|
||||
@@ -354,4 +354,10 @@ export const compatUtils = (
|
||||
|
||||
// Ref sugar macros ------------------------------------------------------------
|
||||
// for dts generation only
|
||||
export { $ref, $computed, $raw, $fromRefs } from './helpers/refSugar'
|
||||
export {
|
||||
$ref,
|
||||
$shallowRef,
|
||||
$computed,
|
||||
$raw,
|
||||
$fromRefs
|
||||
} from './helpers/refSugar'
|
||||
|
||||
Reference in New Issue
Block a user