-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Description
Version
3.0.4
Reproduction link
https://jsfiddle.net/vqkho2xt/2/
Steps to reproduce
const origin = {};
const shallowProxy = shallowReactive(origin);
const reactiveProxy = reactive(origin);
console.log(shallowProxy === reactiveProxy);
What is expected?
shallowProxy !== reactiveProxy
What is actually happening?
shallowProxy === reactiveProxy
why reactive and shallowReactive should return diffrent object ?
may there is the situation: we maybe want to get two different Proxy with the same origin object, the proxy named reactiveProxy returned by reactive , the proxy named shallowProxy returned by shallowReactive, we change the origin objects deep property by reactiveProxy can trigger denpendencies of the deep propery, but we change the origin object
s deep property by shallowProxy should not trigger denpendencies of the deep propery, in this situation, the implements of the vue3 can not satisfy because of that shallowReactive and reactive return the same proxy with the same origin object.