juniorVue.js
What are Computed Properties and how do they differ from Methods?
Updated May 4, 2026
Short answer
Computed properties are cached based on their reactive dependencies, whereas methods execute every time a re-render occurs.
Deep explanation
A computed property will only re-evaluate when some of its reactive dependencies have changed. This is highly efficient for expensive operations (like filtering a large array). Methods, conversely, do not have caching; if the component re-renders for any reason, the method will run again.
Real-world example
Filtering a list of 1000 items based on a search query—only re-filtering when the query or the list changes.
Common mistakes
- Trying to use a computed property as an asynchronous function (computed must be synchronous).
Follow-up questions
- Can computed properties be setters?