Subscribe on changes!

In Vue 3, watching nested properties does not work, but the documentation looks like they should

avatar
Nov 24th 2021

Version

3.2.22

Reproduction link

v3.vuejs.org

Steps to reproduce

Try watching a nested property using the syntax "a.b". See for instance the example from the documentation, starting on line 26 (or 27?, the numbers don't align with the code).

'c.d': function (val, oldVal) {
  // do something
},

What is expected?

Either the watcher should be called, or the lines 26-30 should be removed from the example in the documentation. According to #671, the implementation behavior is correct.

What is actually happening?

The watcher function will not be called, but the documentation looks like it should work.


I think this functionality is really useful, and would rather see it in Vue 3 as well.

avatar
Nov 24th 2021

Sorry, I relied on old info (#671) and had another issue in my code.