Recall & Review
beginner
What happens if you add a new property to a reactive object after it is created in Vue 3?
New properties added to reactive objects are tracked and reactive in Vue 3, unlike Vue 2 where you had to use Vue.set. However, if you add properties to a plain object that is not reactive, Vue won't track them.
Click to reveal answer
intermediate
In Vue 3, what happens if you modify an array by setting an index directly (e.g., arr[1] = value)?
It triggers reactivity because Vue's Proxy system detects array index changes. This was a limitation in Vue 2 where splice or other methods were needed.
Click to reveal answer
intermediate
Explain why Vue's reactivity system might not detect changes to properties inside a Map or Set.
Vue's reactivity system does not automatically track changes inside Map or Set because they are complex data structures. You need to use Vue's reactive APIs or wrap them properly to track mutations.
Click to reveal answer
beginner
What is a common pitfall when using reactive refs with objects in Vue 3?
A common pitfall is forgetting to unwrap refs inside templates or scripts, leading to unexpected behavior. Use .value to access or modify the inner value of a ref.
Click to reveal answer
advanced
Why might deep nested changes in reactive objects sometimes not trigger updates in Vue?
If nested objects are not reactive or created outside Vue's reactive system, changes inside them won't trigger updates. Always create nested objects using reactive or ref to ensure deep reactivity.
Click to reveal answer
In Vue 3, how do you ensure adding a new property to an object is reactive?
✗ Incorrect
In Vue 3, reactive objects track new properties added directly, so you can add them normally.
Which method should you use to update an array element reactively in Vue?
✗ Incorrect
In Vue 3, both splice() and direct index assignment trigger reactivity via Proxy. Splice was essential in Vue 2.
What must you do to track changes inside a Map in Vue's reactivity system?
✗ Incorrect
Vue does not track Map mutations automatically; wrapping with reactive or ref is needed.
How do you access the value inside a ref in Vue 3 scripts?
✗ Incorrect
The .value property holds the inner value of a ref.
Why might changes in deeply nested objects not trigger updates in Vue?
✗ Incorrect
Nested objects must be reactive to trigger updates; otherwise, Vue won't detect changes.
Describe common limitations of Vue's reactivity system and how to work around them.
Think about what Vue can and cannot detect automatically and how to ensure reactivity.
You got /5 concepts.
Explain how direct assignment to array indexes is handled in Vue 3 reactivity and best practices.
Consider how Vue watches array changes.
You got /4 concepts.