From 0b9b88d71446a704702f2ca4fabc15bf4f5ab70c Mon Sep 17 00:00:00 2001 From: Max Novikov Date: Wed, 19 May 2021 13:37:27 +0300 Subject: [PATCH 1/2] fix(match method): added typescript definition of match method in VueRouter class --- types/router.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/router.d.ts b/types/router.d.ts index e6d52425f..80de5e224 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -43,6 +43,7 @@ export declare class VueRouter { go(n: number): void back(): void forward(): void + match (raw: RawLocation, current?: Route, redirectedFrom?: Location): Route getMatchedComponents(to?: RawLocation | Route): Component[] onReady(cb: Function, errorCb?: ErrorHandler): void onError(cb: ErrorHandler): void From c78da6cb48efb0afb9fde26a9071033b1ff80160 Mon Sep 17 00:00:00 2001 From: Max Novikov Date: Wed, 19 May 2021 23:13:08 +0300 Subject: [PATCH 2/2] fix(matched): added test for matched method --- types/test/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/test/index.ts b/types/test/index.ts index 3405e0765..44de15098 100644 --- a/types/test/index.ts +++ b/types/test/index.ts @@ -229,6 +229,8 @@ const Components: ( | AsyncComponent )[] = router.getMatchedComponents() +const match: Route = router.match('/more'); + const vm = new Vue({ router, template: `