Skip to content

Commit 7f1a6d8

Browse files
zigomirposva
authored andcommitted
Query can return an array of strings. (#2050)
1 parent c40425a commit 7f1a6d8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

types/router.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export interface Location {
107107
name?: string;
108108
path?: string;
109109
hash?: string;
110-
query?: Dictionary<string>;
110+
query?: Dictionary<string | string[]>;
111111
params?: Dictionary<string>;
112112
append?: boolean;
113113
replace?: boolean;
@@ -117,7 +117,7 @@ export interface Route {
117117
path: string;
118118
name?: string;
119119
hash: string;
120-
query: Dictionary<string>;
120+
query: Dictionary<string | string[]>;
121121
params: Dictionary<string>;
122122
fullPath: string;
123123
matched: RouteRecord[];

types/test/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const route: Route = router.currentRoute;
105105
const path: string = route.path;
106106
const name: string | undefined = route.name;
107107
const hash: string = route.hash;
108-
const query: string = route.query["foo"];
108+
const query: string | string[] = route.query["foo"];
109109
const params: string = route.params["bar"];
110110
const fullPath: string = route.fullPath;
111111
const redirectedFrom: string | undefined = route.redirectedFrom;
@@ -148,7 +148,8 @@ router.push({
148148
foo: "foo"
149149
},
150150
query: {
151-
bar: "bar"
151+
bar: "bar",
152+
foo: ["foo1", "foo2"]
152153
},
153154
hash: "hash"
154155
});

0 commit comments

Comments
 (0)