Skip to content

Native Vue Router APIs ​

Preserved instance capabilities ​

The proxy retains currentRoute, options, install and native addRoute, hasRoute, getRoutes, resolve, afterEach, beforeResolve, onError, isReady, back, forward and go. push, replace, beforeEach, removeRoute and clearRoutes are extended; addRouter and reloadRoutes are new. See Router API.

resolve only resolves a location; push/replace navigate. Named resolution and navigation still require mandatory params. Native addRoute removal callbacks and direct $instance mutations do not automatically synchronize managed caches.

Re-exported functions ​

The following functions are exported unchanged from the installed vue-router. Its version determines their parameters, return values and limitations:

ExportPurpose
createMemoryHistoryMemory history for tests or SSR
createWebHashHistoryHash history
createWebHistoryHTML5 history; configure server fallbacks
createRouterMatcherLow-level matcher, generally unnecessary for ordinary integration
useRouteCurrent reactive route inside setup
useLinkComposable support for custom links
isNavigationFailureIdentify navigation failures, optionally by type
loadRouteLocationLoad target components; returns a Promise
onBeforeRouteLeave / onBeforeRouteUpdateComponent leave or update guards
parseQuery / stringifyQueryConvert query strings and objects

createRouter/useRouter are library extensions, not unchanged re-exports. Not all Vue Router types are re-exported: import RouterOptions, RouteRecordRaw and NavigationFailure from vue-router. Consult the installed dependency's declarations for exact native signatures rather than maintaining a second copy here.