Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: Location interface typing for query should include arrays #2182

Closed
nowy opened this issue May 1, 2018 · 3 comments
Closed

Typescript: Location interface typing for query should include arrays #2182

nowy opened this issue May 1, 2018 · 3 comments
Labels
Typescript Typescript related issues

Comments

@nowy
Copy link

nowy commented May 1, 2018

Version

3.0.1

Reproduction link

https://router.vuejs.org/en/essentials/navigation.html

Steps to reproduce

When programmatically navigating on vue router, pass through a dictionary with a param as an array. E.g.

{
  "foo": ["bar"]
}

What is expected?

Types are expected to work

What is actually happening?

In router.d.ts, the typing for query, under Location is set to:
Dictionary<string>.

This should be set to allow arrays too. Potentially numbers as well?

@blake-newman blake-newman added bug Typescript Typescript related issues labels May 1, 2018
@posva posva removed the bug label May 1, 2018
@posva posva changed the title Typescript: Location interface typing for query Typescript: Location interface typing for query should include arrays May 1, 2018
@posva
Copy link
Member

posva commented May 1, 2018

It is set to string or string[] which is right.
Unless you use a custom query parser those are the only legal values. Docs should indeed be updated to not use a number.
I'm not sure what is the best option to support different syntaxes based on custom query parser

@nowy
Copy link
Author

nowy commented May 2, 2018

@posva Thanks! Just realised it was done here: #2050
Just hasn't been released. Any knowledge on when next release is?

@rchl
Copy link
Contributor

rchl commented Dec 5, 2018

Seems like #2050 is merged now. This can be closed?

@posva posva closed this as completed Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typescript Typescript related issues
Projects
None yet
Development

No branches or pull requests

4 participants