fix(reactivity): fix ref mutation debugger event values
This commit is contained in:
parent
0b3b1cfa48
commit
b7ef38b773
@ -56,12 +56,7 @@ function createRef(rawValue: unknown, shallow = false) {
|
|||||||
if (hasChanged(toRaw(newVal), rawValue)) {
|
if (hasChanged(toRaw(newVal), rawValue)) {
|
||||||
rawValue = newVal
|
rawValue = newVal
|
||||||
value = shallow ? newVal : convert(newVal)
|
value = shallow ? newVal : convert(newVal)
|
||||||
trigger(
|
trigger(r, TriggerOpTypes.SET, 'value', newVal)
|
||||||
r,
|
|
||||||
TriggerOpTypes.SET,
|
|
||||||
'value',
|
|
||||||
__DEV__ ? { newValue: newVal } : void 0
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,12 +64,7 @@ function createRef(rawValue: unknown, shallow = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function triggerRef(ref: Ref) {
|
export function triggerRef(ref: Ref) {
|
||||||
trigger(
|
trigger(ref, TriggerOpTypes.SET, 'value', __DEV__ ? ref.value : void 0)
|
||||||
ref,
|
|
||||||
TriggerOpTypes.SET,
|
|
||||||
'value',
|
|
||||||
__DEV__ ? { newValue: ref.value } : void 0
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unref<T>(ref: T): T extends Ref<infer V> ? V : T {
|
export function unref<T>(ref: T): T extends Ref<infer V> ? V : T {
|
||||||
|
Loading…
Reference in New Issue
Block a user