- 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.
推薦閱讀
- Application Development with Qt Creator(Second Edition)
- EDA技術(shù)與VHDL編程
- Building Django 2.0 Web Applications
- 物聯(lián)網(wǎng)安全技術(shù)
- Learning Swift(Second Edition)
- TD-LTE無線網(wǎng)絡(luò)規(guī)劃與設(shè)計(jì)
- 深入理解OpenStack Neutron
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 基于IPv6的家居物聯(lián)網(wǎng)開發(fā)與應(yīng)用技術(shù)
- Microservices Development Cookbook
- 加密與解密實(shí)戰(zhàn)全攻略
- 物聯(lián)網(wǎng)商業(yè)設(shè)計(jì)與案例
- 5G時(shí)代邊緣計(jì)算:LF Edge生態(tài)與EdgeGallery技術(shù)詳解
- SNS網(wǎng)站構(gòu)建
- 互聯(lián)網(wǎng)下一站:5G與AR/VR的融合