How to add a new file with routes in vue?

I have a main router.js file where I want to use the another file with routes – routeManagement.

router.js:

import routesManagement from './routesManagement'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Dashboard',
    component: Dashboard
  },
  
  routesManagement,
]
export default router

routesManagement.js:

import Tools from '../../views/management/Tools.vue'

const routeManagement = [
    {
        path: '/tools',
        name: 'Tools',
        component: Tools
    },
]
export default routeManagement

When I do this, the app stops working and I get an error:

Uncaught Error: [vue-router] "path" is required in a route configuration.

How to fix it? What am I doing wrong?

Source: Ask Javascript Questions

LEAVE A COMMENT