- Vue.js Quick Start Guide
- Ajdin Imsirovic
- 98字
- 2021-06-24 18:23:57
Computed properties and methods
The usefulness of reactivity in Vue can be described in terms of the difference between computed properties and methods.
As we mentioned earlier, a Vue instance can have either computed properties, methods, or both computed properties and methods. So, what is the difference between the two?
Methods are simply run every time they are called. On the other hand, computed properties are cached, meaning they are only run when the underlying data model changes. This is often described in terms of computed property dependencies. Also, methods can have parameters, whereas computed properties cannot.
推薦閱讀
- 智能網聯汽車V2X與智能網聯設施I2X
- 工業控制網絡安全技術與實踐
- 5G承載網網絡規劃與組網設計
- 2018網信發展報告
- React:Cross-Platform Application Development with React Native
- Yii Application Development Cookbook(Second Edition)
- 網絡基礎與網絡管理項目化教程
- IPv6網絡切片:使能千行百業新體驗
- Master Apache JMeter:From Load Testing to DevOps
- 設備監控技術詳解
- 現代通信系統(第5版)
- 現場綜合化網絡運營與維護:運營商數字化轉型技術與實踐
- Hands-On Reactive Programming in Spring 5
- 中國信息化年鑒2017
- 智能物聯安防視頻技術基礎與應用