Closed
Description
Version
2.7.0
Reproduction link
https://jsfiddle.net/50wL7mdz/82013/ (This doesn't actually work, but shows the code you'd need locally to repro the bug)
Steps to reproduce
-
Note that JSFiddle doesn't appear to give Typescript compiler errors, so the repro linked will have to be ported into a local Typescript Vue project.
-
In a Typescript Vue project:
router.push({ query: { array: ["1", "2", "3"] }})
What is expected?
This should compile without error
What is actually happening?
You get an error:
error TS2345: Argument of type '{ name: string; query: QueryParams; }' is not assignable to parameter of type 'RawLocation'.
Type '{ name: string; query: QueryParams; }' is not assignable to type 'Location'.
Types of property 'query' are incompatible.
Type 'QueryParams' is not assignable to type 'Dictionary<string> | undefined'.
Type 'QueryParams' is not assignable to type 'Dictionary<string>'.
Index signatures are incompatible.
Type 'string | string[] | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
Metadata
Metadata
Assignees
Labels
No labels