From 51314388e98f6d0ff282f3f423eddfb6550ecab0 Mon Sep 17 00:00:00 2001 From: daiwei Date: Thu, 10 Jul 2025 16:31:28 +0800 Subject: [PATCH] fix(ref): store old value in RefImpl when value changes --- packages/reactivity/src/ref.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 92a4ba7f1de..eb77900319f 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