From beed74301f7e6a4fa4ae610fcc7e85e2687f59db Mon Sep 17 00:00:00 2001 From: zigomir Date: Tue, 6 Feb 2018 18:30:45 -0800 Subject: [PATCH] Query can return an array of strings. --- types/router.d.ts | 4 ++-- types/test/index.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/types/router.d.ts b/types/router.d.ts index e42be34b8..c6c8eef65 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -107,7 +107,7 @@ export interface Location { name?: string; path?: string; hash?: string; - query?: Dictionary; + query?: Dictionary; params?: Dictionary; append?: boolean; replace?: boolean; @@ -117,7 +117,7 @@ export interface Route { path: string; name?: string; hash: string; - query: Dictionary; + query: Dictionary; params: Dictionary; fullPath: string; matched: RouteRecord[]; diff --git a/types/test/index.ts b/types/test/index.ts index e87cc51a8..20cf16c52 100644 --- a/types/test/index.ts +++ b/types/test/index.ts @@ -105,7 +105,7 @@ const route: Route = router.currentRoute; const path: string = route.path; const name: string | undefined = route.name; const hash: string = route.hash; -const query: string = route.query["foo"]; +const query: string | string[] = route.query["foo"]; const params: string = route.params["bar"]; const fullPath: string = route.fullPath; const redirectedFrom: string | undefined = route.redirectedFrom; @@ -148,7 +148,8 @@ router.push({ foo: "foo" }, query: { - bar: "bar" + bar: "bar", + foo: ["foo1", "foo2"] }, hash: "hash" });