From 4d359970405ffc8539644fb3374fc1ab3883aa99 Mon Sep 17 00:00:00 2001 From: zhangenming <282126346@qq.com> Date: Fri, 20 Aug 2021 16:58:33 +0800 Subject: [PATCH] chore(reactivit): use explicit assignments. --- packages/reactivity/src/ref.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 0747f8e1314..11bc4d35290 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 }