Преглед на файлове

fix(ref): store old value in RefImpl when value changes

daiwei преди 9 месеца
родител
ревизия
51314388e9
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      packages/reactivity/src/ref.ts

+ 1 - 0
packages/reactivity/src/ref.ts

@@ -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