Question 28
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.
What will be rendered when the user first navigates to /products/electronics?
An empty array because displayedProducts is initialized as null
All three products because the watch handler hasn't been triggered yet
Only the Laptop and Phone (both electronics)
The data will show an error because the category doesn't exist in the array