Nested routes

Nested routes differ from sub-routes as they exist within a component already matching the beginning part of a route. This allows you to show different content within an existing view.

A good example of this would be Twitter. If you visit a Twitter user's profile page, you are able to view who they are following, who follows them, and what lists they've created. If you observe the URL while you navigate through the pages, you will notice a recurring pattern: the username followed by the different page. The difference between nested routes and sub-routes is that nested routes allow you to keep components the same throughout the different sub-pages (for example, the header and sidebar).

The advantages of this are that the user ...

Get Vue.js 2.x by Example 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.