Question 11
Filename: app.js
const inventory = { 101: {product: "Canvas", quantity: 15, warehouse: 3}, 102: {product: "Brushes", quantity: 8, warehouse: 2}}
const errorPage = { template: `<h1>Item not found in inventory!</h1>`}
const productDetails = { template: `<h1>{{item.product}} - {{item.quantity}} units stored in {{item.warehouse}} locations.</h1>`, data() { return {item: inventory[this.$route.params.productId]} }, watch: { '$route'(to, from) { this.item = inventory[to.params.productId] } }}
const router = new VueRouter({ mode: 'history', routes: [ { path: '/inventory/:productId', component: productDetails }, { path: '*', component: errorPage }, ],})
new Vue({ el: '#app',
template: '<div><router-view /></div>', router,})Suppose the application is running on "http://localhost:3000", select the correct option(s)?