-
Notifications
You must be signed in to change notification settings - Fork 186
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
Unable to use Vuex + namespace with Typescript #198
Comments
Maybe And
|
Hi, I'm facing the same issue. Unfortunately such code doesn't fix it:
Are there any workarounds? |
@karol-f that does not work either. The only way I got this to work was by manually setting this.$store = store in beforeCreate of the component which is less than ideal |
Unfortunately I don't have much experience with Typescript (yet). PR's are welcome. We can ask if @isaaclyman can have a look but I assume he is now busy man (like we all due to virus). |
I don't see any TypeScript-specific annotations or errors. If it were a TS issue, casting to |
If anyone stumbles upon this thread I found an extremely simple solution to this issue. This works for issues with VueX store as well as Vue Router. When defining your parent component you can do the following -
In your
You will then be able to access your |
Hi,
I am doing the following in typescript
But I am getting the following error because the store is not present in the new component:
If I instead do
The store is there but the component fails to render:
Anything I can do to include the store in typescript?
I also tried the suggestion here but no dice #161
The text was updated successfully, but these errors were encountered: