Skip to content
Vue.js Tutorials
  • Tutorials
  • 📼 Video Courses
  • Vue.js Workshops
Night Mode
Text Size

Vue.js Courses and Tutorials

Creating Your Own Router

Probably you’ve been using routers in the frontend world for a while, but… have you ever written one by yourself? Do you know the foundations of a router? It might seem like it just works, but under the hood, a router must take care of several things.

A router is the component in charge of routing. We can define routing as the action of finding the way to multiple destinations. This applies to different areas.

For instance, an elevator’s router will take you to the fifth floor if you press the button with the number 5 on it.

In web development, we can see two main areas of routing:

Creating Your Own Vue.js Router

Posted on Updated March 28, 2018January 26, 2018 by Alex Jover Morales
Creating Your Own Vue.js Router

Have you ever created a Vue.js Router by yourself? Do you know the foundations of a router? When we use one from a framework or plugin it might seem like it just works, but under the hood, a router must take care of several things.

In this series, we’ll take a look at how we can build our own Vue.js router.

Enhance Router To Work With Single Page Applications

Posted on Updated March 28, 2018January 26, 2018 by Alex Jover Morales
Enhance Router To Work With Single Page Applications

At this point, the router doesn’t work as a Single Page App (SPA) router, since it assigns a new route to `window.location` directly, which performs a hard reload.

Let’s see what we have to do to adapt our router to serve as a SPA router.

Lazy Load Routes

Posted on Updated March 28, 2018January 26, 2018 by Alex Jover Morales
Lazy Load Routes

Lazy Loading and Code Splitting are two of the main points of the PRPL Pattern, a pattern named by Google which intent is to to provide some structure to make the initial load of a Progressive Web App (PWA) as fast as possible, boosting the performance.

Make the Router a Vue.js Plugin

Posted on Updated July 4, 2018February 12, 2018 by Alex Jover Morales
Make the Router a Vue.js Plugin

So far we’ve build the router in a component and a history module within the source code of our app. The problem of it is that the router is tied to the app, specially because the routes are defined within the AppRouter component. That could be improved by moving out the routes from the component […]

© 2021 VueSchool.io
×