Question 29
Consider the following Vue.js application with two different route scenarios and a component that uses reactive data binding:
Scenario: An e-commerce application where:
• Product list component displays products filtered by category
• Category changes through router parameters: /products/:category
• When a user navigates from /products/electronics to /products/books, the product list should update
Based on the above data, answer the given subquestions.
When the user navigates from /products/electronics to /products/books, what will happen and why?
The computed property will not update because it's being used in a watch handler
The computed property will automatically re-evaluate because the route parameter dependency changed
The displayedProducts variable will update, but the computed property will display stale data
Both the computed property and displayedProducts will update to show books