diff --git a/types/router.d.ts b/types/router.d.ts index 59222587d..dc4516bbd 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -108,7 +108,7 @@ export interface Location { name?: string; path?: string; hash?: string; - query?: Dictionary; + query?: Dictionary; params?: Dictionary; append?: boolean; replace?: boolean; @@ -118,7 +118,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 20cf16c52..abb5395b3 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 | string[] = route.query["foo"]; +const query: string | (string | null)[] | null = route.query["foo"]; const params: string = route.params["bar"]; const fullPath: string = route.fullPath; const redirectedFrom: string | undefined = route.redirectedFrom; @@ -149,6 +149,9 @@ router.push({ }, query: { bar: "bar", + empty: null, + removed: undefined, + withEmpty: ["1", null], foo: ["foo1", "foo2"] }, hash: "hash"