From: daiwei Date: Thu, 10 Jul 2025 08:31:28 +0000 (+0800) Subject: fix(ref): store old value in RefImpl when value changes X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13607%2Fhead;p=thirdparty%2Fvuejs%2Fcore.git fix(ref): store old value in RefImpl when value changes --- diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 92a4ba7f1d..eb77900319 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -168,6 +168,7 @@ class RefImpl implements ReactiveNode { if (hasChanged(newValue, oldValue)) { this.flags |= _ReactiveFlags.Dirty this._rawValue = newValue + this._oldValue = oldValue this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue const subs = this.subs