diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 0747f8e1..11bc4d35 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -79,7 +79,7 @@ export function ref(value: T): ToRef export function ref(value: T): Ref> export function ref(): Ref export function ref(value?: unknown) { - return createRef(value) + return createRef(value, false) } export function shallowRef( @@ -98,7 +98,7 @@ class RefImpl { public dep?: Dep = undefined public readonly __v_isRef = true - constructor(value: T, public readonly _shallow = false) { + constructor(value: T, public readonly _shallow: boolean) { this._rawValue = _shallow ? value : toRaw(value) this._value = _shallow ? value : convert(value) } @@ -118,7 +118,7 @@ class RefImpl { } } -function createRef(rawValue: unknown, shallow = false) { +function createRef(rawValue: unknown, shallow: boolean) { if (isRef(rawValue)) { return rawValue }