Routing in Vue.js

Learn how routing is used in Vue.js to navigate between different pages in a single-page application.

Introduction

Vue-router handles routing in Vue.js. When we were scaffolding our application in the lesson “Structuring Vue.js Application,” we selected “Router” when we used the command vue create educative-whatsapp-application. This means vue-router was installed and configured in our project. If we want to manually install it, we use the following command and update the main.js file.

// install vue-router
npm install vue-router

Get hands-on with 1200+ tech skills courses.