In some component, I have this:
export default {
data() {
return {
a: 'a',
b: {}
};
}
}
Now, if I do this.a = 'aa'; somewhere, and I use this.a in a computed function, then everything happily updates reactively. If, however, I do this.b.key = 'bb'; ... then nothing happens. That is, this.b is not updated reactively, which makes us sad.
After some testing, it seems that I can trigger reactive updates to this.b, but only by assigning this.b = completelyNewObject; ... which is awkward.
Furthermore, in this case, this.b is not iterable, which makes using it in a computed function rather difficult.
So... what am I doing wrong here?