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

Cannot access params when using typescript in vueclass #2756

Closed
j-d-carmichael opened this issue May 4, 2019 · 1 comment
Closed

Cannot access params when using typescript in vueclass #2756

j-d-carmichael opened this issue May 4, 2019 · 1 comment

Comments

@j-d-carmichael
Copy link

j-d-carmichael commented May 4, 2019

Version

3.0.3

Reproduction link

https://i.stack.imgur.com/heuWw.png

Steps to reproduce

Try to access the params of a route within the typescript vue class as illustrated above and the compiler cannot resolve params.

What is expected?

That the params are found and no error is thrown

What is actually happening?

Typescript throws an error


The only way to get this working right now for me is to:
1 - Import the router to the component
2 - Access the params via string literals: router['history'].current.params.hash

This however breaks my linter.

@posva
Copy link
Member

posva commented May 4, 2019

it's this.$route.params. router.history is not public API btw


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂

@posva posva closed this as completed May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants