]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(reactivity): fix ref mutation debugger event values
authorEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 16:01:25 +0000 (12:01 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 28 Jul 2020 16:01:34 +0000 (12:01 -0400)
packages/reactivity/src/ref.ts

index cf217c3db39fc531cf79a8bb72f8fd73b981b344..25473b4cc8c0abcc991317a1a90aa064f90cb91c 100644 (file)
@@ -56,12 +56,7 @@ function createRef(rawValue: unknown, shallow = false) {
       if (hasChanged(toRaw(newVal), rawValue)) {
         rawValue = newVal
         value = shallow ? newVal : convert(newVal)
-        trigger(
-          r,
-          TriggerOpTypes.SET,
-          'value',
-          __DEV__ ? { newValue: newVal } : void 0
-        )
+        trigger(r, TriggerOpTypes.SET, 'value', newVal)
       }
     }
   }
@@ -69,12 +64,7 @@ function createRef(rawValue: unknown, shallow = false) {
 }
 
 export function triggerRef(ref: Ref) {
-  trigger(
-    ref,
-    TriggerOpTypes.SET,
-    'value',
-    __DEV__ ? { newValue: ref.value } : void 0
-  )
+  trigger(ref, TriggerOpTypes.SET, 'value', __DEV__ ? ref.value : void 0)
 }
 
 export function unref<T>(ref: T): T extends Ref<infer V> ? V : T {