Can someone help me understand why my Vue
object is not reactive to changes in another object? See the code snippet below.
exampleObject = {
exampleProperty: null
}
exampleObject.update = function () {
this.exampleProperty = 'updated data'
}
exampleVue = new Vue({ data: exampleObject.exampleProperty })
console.log(exampleVue.data) // Outputs: null
exampleObject.update()
console.log(exampleVue.data) // Still outputs: null... Shouldn't it be displaying 'updated data'?
I'd appreciate any insights on where I might have gone wrong with this implementation. Thanks!