Subscribe on changes!

Deep watch is broken on new objects

avatar
Jul 17th 2022

Vue version

3.2.37

Link to minimal reproduction

https://codesandbox.io/s/sharp-panka-1bdedt?file=/src/App.vue

Steps to reproduce

Just open codesandbox. You will see text "Changed 1 times" but I expect it to be "Changed 2 times"

What is expected?

Text to be "Changed 2 times"

What is actually happening?

When I have deep watcher on someobject, it does not work if I change inner object

Text is "Changed 1 times"

System Info

No response

Any additional comments?

I don't now is it a bug or feature. In vue 2 we have Vue.set() and it works as expected

avatar
Jul 17th 2022

Synchronous changes dont trigger a watcher multiple times unless flush: 'sync' is used.