If calculated property
var vm = new Vue({
data: {
a: 'hi',
b:'buu',
c: 'zzz'
},
computed: {
example: {
return this.a + this.b
}
}
})
If attributes a and b change, the calculated attributes will change responsively. How is this mechanism implemented?
How to know the changes in a and b inside?
Thanks for the invitation.
I don’t know about VUE, but this change of attribute value is just like the difference between reference and valuein other languages.
Example:
Suppose the address referenced by a is 0xaaa0, and the value loaded by 0xaaa0 is 'hi0'
Change the address referenced by a to 0xaaa1, and the value loaded by 0xaaa1 is 'hi1'
Then when a is obtained, the value changes.
Look at the in-depth response part of the vue documentation