From: Eduardo San Martin Morote Date: Fri, 17 Apr 2020 18:33:16 +0000 (+0200) Subject: feat: add `$route` and `$router` types X-Git-Tag: v4.0.0-alpha.7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4f80aaaafb1bf29a3f4d992e8c6a2bec0f70d62;p=thirdparty%2Fvuejs%2Frouter.git feat: add `$route` and `$router` types --- 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) {