CHAPTER 12
Beginner
Computed Properties and Watchers
Updated: May 18, 2026
5 min read
# CHAPTER 12
Computed Properties and Watchers
1. Chapter Introduction
computed and watch are Vue's two tools for reactive programming beyond templates. Computed properties are for derived state (values calculated from other reactive data). Watchers are for side effects (running code when data changes). Knowing when to use each is a mark of Vue expertise.
2. Learning Objectives
- Create computed properties for derived state.
- Understand computed caching.
-
Use
watchfor side effects.
-
Use
watchEffectfor automatic dependency tracking.
- Know when to use computed vs watch.
3. Computed Properties
vue
4. Writable Computed
vue
5. watch — Watching for Changes
vue
6. computed vs watch vs watchEffect
text
7. Common Mistakes
-
Putting async code in computed:
computed(async () => ...)does NOT work. Usewatchfor async operations.
- Mutating other reactive state in computed: Computed should be pure — no side effects, no mutation.
8. MCQs
Question 1
Computed properties are cached based on?
Question 2
When do you use watch over computed?
Question 3
What does { immediate: true } in watch do?
Question 4
{ deep: true } in watch is for?
Question 5
watchEffect vs watch?
Question 6
Writable computed requires?
Question 7
Can computed be async?
Question 8
Watch multiple sources?
Question 9
Stop a watchEffect by?
Question 10
Computed accessing items.value.length recalculates when?
9. Interview Questions
- Q: What is the difference between a computed property and a method in Vue?
-
Q: When would you use
watchEffectvswatch?
10. Summary
Computed properties are Vue's most powerful feature for deriving state — they cache intelligently and update automatically. Watchers are the tool for async operations, API calls, and persistence side effects. The rule is simple: need a value → computed, need a side effect → watch.11. Next Chapter Recommendation
In Chapter 13: Vue Lifecycle Hooks, we understand the component lifecycle from creation to unmounting and learn how to hook into each phase withonMounted, onUpdated, and onUnmounted.