From a4f80aaaafb1bf29a3f4d992e8c6a2bec0f70d62 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 17 Apr 2020 20:33:16 +0200 Subject: [PATCH] feat: add `$route` and `$router` types --- src/router.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/router.ts b/src/router.ts index 50a82ea8..81d52d90 100644 --- a/src/router.ts +++ b/src/router.ts @@ -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) { -- 2.47.3