routeUtils.js 415 B

1234567891011
  1. /**
  2. * Merge route groups into the flat array expected by vue-router.
  3. *
  4. * Route modules are commonly exported as arrays so they can contain one or
  5. * more route records. Passing one of those arrays directly to the router
  6. * creates an invalid top-level route entry and can make the sidebar crash
  7. * while reading `route.path`.
  8. */
  9. export function mergeRouteRecords(...routeGroups) {
  10. return routeGroups.flat()
  11. }