Fix tslint issue on Quasar component (getting the value from the Vuex Store)
-
At Quasar, I am using root.$store.getters to get the values from the Vuex Store. but as Quasar is based on typescript, I got the tslint issue like the following image.
please help me how I fix the above tslint issue.
Regards
-
@forevereffort said in Fix tslint issue on Quasar component (getting the value from the Vuex Store):
but as Quasar is based on typescript
I don’t thinks so.
You could disable eslint for some lines of code:
https://stackoverflow.com/questions/27732209/turning-off-eslint-rule-for-a-specific-line -
hello @dobbel thanks for your comment. but instead of disabling eslint, if possible, can I define the correct type for root.$store.getters[‘app/filter’]?
-
Here’s an article that might help:
https://medium.com/swlh/properly-typed-vuex-stores-427bf4c6a3d1The repo that gives vuex types:
https://github.com/mrcrowl/vuex-typex -
@dobbel said in Fix tslint issue on Quasar component (getting the value from the Vuex Store):
Here’s an article that might help:
https://medium.com/swlh/properly-typed-vuex-stores-427bf4c6a3d1The repo that gives vuex types:
https://github.com/mrcrowl/vuex-typexHello @dobbel
by using vuex-composition-helpers, I fixed the above issues. my working code like the following.
as you see, is this good solution?
Regards
-
Sure if it works and you have types now.