-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Query/Location can be an array of strings. (fix #1932) #2050
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Oh thanks! |
it's very helpful to me ! (after release |
Any plans when this is going to be released? It's been more than 6 months since last release! |
I see that this was released in the last day or two and I've started getting typescript errors. With v3.0.1 I was able to do the following:
after updating to v3.0.2 the above code throws an error that type Was my example above working by accident? It seems that the only way to get this to work is to rewrite it as
which is sub-optimal, but perhaps I'm doing something wrong? |
Same issue here, our code has been assuming Seems like for safety, we should change the code to Alternatively, had the breaking change been to switch to |
It was working by coincidence – see Otherwise I agree it could be nicer to always return same type |
Yeah, makes sense. I can also see that the "new" definition ( |
I think the string vs array was not clearly documented in https://github.com/vuejs/vue-router/tree/dev/docs/api#route-object-properties (there, |
Is splashing |
I'm experiencing this issue as well. It feels like semantic versioning rules were not followed here. A patch release that contains a type change on a public API is normally not allowed. I know I'm pointing out the obvious, but just venting my frustration a bit. |
I'd argue that public API wasn't changed – typings were wrong in the first place. But I can see your frustration – I felt it before, because typings were wrong. |
I suppose that's what we get when we're adding Typescript in after the fact; but it never the less is a breaking change since definitions are provided. In any event, lets all look forward to v4 where this will get a correction. |
Disappointment. I have to change my code about the query, such as:
Hope can fix it in the future. |
Query and Location can be arrays as can be deduced from a spec here and here.
I guess for custom parsing user needs to provide own types and override ones coming from router somehow.