- Full-Stack Vue.js 2 and Laravel 5
- Anthony Gore
- 140字
- 2021-07-02 19:57:21
Reactive data properties
Another one of Vue's initialization steps is to walk through all of the data properties and assign them getters and setters. If you look in the following screenshot, you can see how each property in our current app has agetandsetfunction added to it:

Figure 2.9. Getters and setters
Vue added these getters and setters to enable it to perform dependency tracking and change notification when the properties are accessed or modified. So, when thecontractedvalueis changed by theclickevent, itsset method is triggered. Thesetmethod will set the new value, but will also carry out a secondary task of informing Vue that a value has changed and any part of the page relying on it may need to be re-rendered.
If you'd like to know more about Vue's reactivity system, check out the articleReactivity In Vue.js (And Its Pitfalls) athttps://vuejsdevelopers.com/2017/03/05/vue-js-reactivity/.
- Learning Neo4j
- Learning ROS for Robotics Programming(Second Edition)
- Redis Applied Design Patterns
- Hadoop+Spark大數據分析實戰(zhàn)
- 可解釋機器學習:模型、方法與實踐
- Cocos2d-x學習筆記:完全掌握Lua API與游戲項目開發(fā) (未來書庫)
- Android應用案例開發(fā)大全(第二版)
- Visual Basic程序設計習題與上機實踐
- STM8實戰(zhàn)
- Unity Android Game Development by Example Beginner's Guide
- Spark技術內幕:深入解析Spark內核架構設計與實現原理
- Python無監(jiān)督學習
- JavaScript語法簡明手冊
- 微信公眾平臺開發(fā)最佳實踐
- Internet of Things with Arduino Cookbook