fix(reactivity): shallowReactive should not unwrap refs (#12605)

fix #12597
This commit is contained in:
Deft 2022-07-04 10:33:44 +08:00 committed by GitHub
parent 8cdd0ac07e
commit 15b9b9b19d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ export function defineReactive(
} }
} }
} }
return isRef(value) ? value.value : value return isRef(value) && !shallow ? value.value : value
}, },
set: function reactiveSetter(newVal) { set: function reactiveSetter(newVal) {
const value = getter ? getter.call(obj) : val const value = getter ? getter.call(obj) : val