In the following steps, we will create the router manager that will control all the routes on the application:
- Open the index.js in the src/router folder.
- Import the newly created user.js file in the src/router folder:
import Vue from 'vue';
import VueRouter from 'vue-router';
import UserRoutes from './user';
- In the routes array, add the imported UserRoutes as a destructed array:
const routes = [
...UserRoutes,
{
path: '*',
redirect: '/user',
},
];