vue-router#createMemoryHistory JavaScript Examples

The following examples show how to use vue-router#createMemoryHistory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.js    From vitedge with MIT License 7 votes vote down vote up
export function resolvePropsRoute(routes, path, base) {
  const url = createUrl(path)
  url.pathname = withoutPrefix(url.pathname, PROPS_PREFIX + '/')

  const routeBase = base && withoutSuffix(base({ url }), '/')
  const fullPath = getFullPath(url, routeBase)

  const router = createRouter({
    routes,
    history: createMemoryHistory(routeBase),
  })

  return buildPropsRoute(router.resolve(fullPath))
}
Example #2
Source File: main.js    From LoR_Master with MIT License 5 votes vote down vote up
router = createRouter({
  history: IS_ELECTRON ? createMemoryHistory() : createWebHistory(),
  routes, // short for `routes: routes`
})