]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(ref): store old value in RefImpl when value changes edison/fix/refDirty 13607/head
authordaiwei <daiwei521@126.com>
Thu, 10 Jul 2025 08:31:28 +0000 (16:31 +0800)
committerdaiwei <daiwei521@126.com>
Thu, 10 Jul 2025 08:31:28 +0000 (16:31 +0800)
packages/reactivity/src/ref.ts

index 92a4ba7f1de6c156e68b91d444d2b26e94077306..eb77900319f7ccf3325eb27154e5e2b37d73d85d 100644 (file)
@@ -168,6 +168,7 @@ class RefImpl<T = any> 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