]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
feat: add `$route` and `$router` types
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 17 Apr 2020 18:33:16 +0000 (20:33 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 17 Apr 2020 18:33:16 +0000 (20:33 +0200)
src/router.ts

index 50a82ea8f480c66150996dc5898ff804879bd6b8..81d52d9039d5685cbfb98d42614a9936134dae1e 100644 (file)
@@ -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) {