Vue.js Quick Start Guide
上QQ阅读APP看书,第一时间看更新

How does Vue achieve this?

Vue stores its data in the data option, which is either a function or an object:

...
data: {
// the model goes here
}
...

Any change in the data model is reflected in the view (on the screen). Vue achieves this reactivity with the help of getters and setters. When the data object is received by the Vue instance, all the properties of the data object will be updated as getters and setters. This is done with the help of the Object.defineProperty API.