Skip to content

Commit

Permalink
feat: add $route and $router types
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Apr 17, 2020
1 parent c7ccd5a commit a4f80aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,17 @@ declare module '@vue/runtime-core' {
*/
beforeRouteLeave?: NavigationGuard
}

interface ComponentCustomProperties {
/**
* Normalized current location. See {@link RouteLocationNormalizedLoaded}.
*/
$route: RouteLocationNormalizedLoaded
/**
* {@link Router} instance used by the application.
*/
$router: Router
}
}

function applyRouterPlugin(app: App, router: Router) {
Expand Down

0 comments on commit a4f80aa

Please sign in to comment.