Finalizing the Shop Vue-router URLs
We're now at a stage where we can finalize the URLs for our shop - including creating the redirects and Checkout links. Referring back to Chapter 8, Introducing Vue-Router and Loading URL-Based Components, we can see which ones we are missing. These are:
/category
-redirect to/
/product
- redirect to/
/basket
- loadOrderBasket
component/checkout
- loadOrderCheckout
component/complete
- loadOrderConfirmation
component
Create the redirects in the appropriate places within the routes array. At the bottom of the routes array, create three new routes for the Order
components:
routes: [ { path: '/', name: 'Home', ... }, { path: '/category', redirect: {name: 'Home'} }, { path: '/category/:slug', name: 'Category', ... }, { path: '/product', redirect: {name: 'Home'} }, { path: '/product/:slug', name: 'Product', component: ProductPage }, { path: '/basket', name: 'Basket', component: OrderBasket...