2. 入口文件
入口文件 index.ts
里全是 export
语句,大约有以下几类 API:
history
模块matcher
模块router
模块RouterView
模块RouterLink
模块navigationGuards
模块errors
模块其它
query
useApi
globalExtensions
injectionSymbols
config
types
// history
export { createWebHistory } from './history/html5'
export { createMemoryHistory } from './history/memory'
export { createWebHashHistory } from './history/hash'
export type { RouterHistory, HistoryState } from './history/common'
// matcher
export { createRouterMatcher } from './matcher'
export type { RouterMatcher } from './matcher'
export type { RouteRecord, RouteRecordNormalized } from './matcher/types'
export type { PathParserOptions, _PathParserOptions } from './matcher/pathParserRanker'
// router, RouterView, RouterLink
export { createRouter } from './router'
export type { Router, RouterOptions, RouterScrollBehavior } from './router'
export { RouterView } from './RouterView'
export type { RouterViewProps } from './RouterView'
export { RouterLink, useLink } from './RouterLink'
export type { _RouterLinkI, RouterLinkProps, UseLinkOptions } from './RouterLink'
// navigationGuards
export {
onBeforeRouteLeave,
onBeforeRouteUpdate,
loadRouteLocation,
} from './navigationGuards'
// errors
export { NavigationFailureType, isNavigationFailure } from './errors'
export type { NavigationFailure, ErrorTypes, NavigationRedirectError } from './errors'
Last updated