Introducing vue-router
vue-router is the official router package built and maintained by the Vue.js core team and community members. Just like other packages that we have introduced so far in the Companion App, also vue-router was automatically set up for us when we initialized our application using Vite.
In this section, we will learn about the file structure and configuration required for vue-router and introduce some of the syntax used when working with routes.
vue-router offers a standard set of functionalities that are expected from a router. So, if you have previously worked with routers in other languages, most of what we will cover will sound familiar, but it is still worth a read as the syntax may be different.
Learning about vue-router configuration
Let’s first start by learning how to best configure the router in an application. In fact, even if vue-router is usually preset by tools such as createVue and Vite, it is important to understand how it is set...