- Vue.js Quick Start Guide
- Ajdin Imsirovic
- 100字
- 2021-06-24 18:23:57
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.