- 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.
推薦閱讀
- 智慧城市:大數(shù)據(jù)、互聯(lián)網(wǎng)時代的城市治理(第4版)
- Building Django 2.0 Web Applications
- 物聯(lián)網(wǎng)安全:理論、實踐與創(chuàng)新
- TCP/IP入門經(jīng)典(第5版)
- JBoss EAP6 High Availability
- 網(wǎng)絡(luò)互聯(lián)技術(shù)(實踐篇)
- Building RESTful Web Services with Spring 5(Second Edition)
- 企業(yè)私有云建設(shè)指南
- 大話社交網(wǎng)絡(luò)
- Socket.IO Real-time Web Application Development
- 計算機(jī)網(wǎng)絡(luò)與通信(第2版)
- 數(shù)字調(diào)制解調(diào)技術(shù)的MATLAB與FPGA實現(xiàn):Altera/Verilog版(第2版)
- Spring 5.0 Projects
- 網(wǎng)絡(luò)基礎(chǔ)與網(wǎng)絡(luò)管理項目化教程
- 從實踐中學(xué)習(xí)手機(jī)抓包與數(shù)據(jù)分析