[Vuejs]-How does Vue.js set observers in computed properties?

0👍

Provided that the this.$store.state and this.$store.state.name properties are reactive (they should be), then Vue will observe changes to these properties and re-evaluate greeting when the values of these properties change.

No other properties will be observed.

This will cause greeting to be re-evaluated:

this.$store.state.name = 'foo';
this.$store.state = bar();

This will not cause greeting to be re-evaluated:

this.$store.state.foo = 'foo';
this.$store.state.a.b.c = 'bar';
this.$store.apple = 'pink lady';

Leave a comment