Question 27
Consider the following Vue 2 (CDN) code. html code:
script:
Based on the above data, answer the given subquestions.
Why is the watcher on $route.params.id necessary in this code?
Without it, the userId in data would never change when the route changes.
It is required because Vue Router does not automatically update component data.
It prevents the component from being destroyed and recreated on every navigation.
Both Without it, the userId in data would never change when the route changes and It is required because Vue Router does not automatically update component data are correct.