- 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/.
- GraphQL學(xué)習(xí)指南
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設(shè)計(jì)模式
- Android Application Development Cookbook(Second Edition)
- C語(yǔ)言實(shí)驗(yàn)指導(dǎo)及習(xí)題解析
- Hands-On Functional Programming with TypeScript
- bbPress Complete
- MATLAB 2020從入門到精通
- Python從入門到精通
- Django 3.0入門與實(shí)踐
- .NET 4.5 Parallel Extensions Cookbook
- Hands-On Neural Network Programming with C#
- 交互式程序設(shè)計(jì)(第2版)
- 征服C指針(第2版)
- Ionic3與CodePush初探:支持跨平臺(tái)與熱更新的App開發(fā)技術(shù)
- Google Maps JavaScript API Cookbook