Skip to content

Commit

Permalink
refactor(router): remove history property
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the history property was marked as internal already. Since we
need to pass the history instance to the router, we always have access to it,
differently from Vue Router 3 where the history was instantiated internally.
The history API was also internal (it wasn't documented), so this change
shouldn't be a problem as people shouldn't be relying on `router.history` in
their apps. If you think this property is needed, please open an issue to
discuss the use case. Note it's already accessible as you have to create it:
```js
export const history = createWebHistory()
export const router = createRouter({ history, routes: [] })
```
  • Loading branch information
posva committed Jul 3, 2020
1 parent 10a071c commit aba3a3f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export interface Router {
/**
* @internal
*/
readonly history: RouterHistory
// readonly history: RouterHistory
readonly currentRoute: Ref<RouteLocationNormalizedLoaded>
readonly options: RouterOptions

Expand Down Expand Up @@ -910,7 +910,6 @@ export function createRouter(options: RouterOptions): Router {
onError: errorHandlers.add,
isReady,

history: routerHistory,
install(app: App) {
const router = this
app.component('RouterLink', RouterLink)
Expand Down

0 comments on commit aba3a3f

Please sign in to comment.