How it works…

When the root route is matched, the Home component won't be loaded. The path of /last-year-sales will be matched instead. We can also omit the component altogether since it will never be loaded:

{ path: '/', redirect: '/last-year-sales' }

Get Vue.js 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.