Great post. I’m curious that everything you did is just TypeScript things except defining global $store type, so isn’t possible to do the same in Vue 2 + Vuex 3 and have a fully typed store?
What we did in our project is that we just removed the global vuextypes/vue.d.ts files, and used the approach with Vue 2.x. Take a look at npm-patch-package. Then you can just comment out these lines and apply the patch. That's it, you can type the store in 2.x.
I also like the idea that API and code stay the same, we just enhance typings.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great post. I’m curious that everything you did is just TypeScript things except defining global $store type, so isn’t possible to do the same in Vue 2 + Vuex 3 and have a fully typed store?
What we did in our project is that we just removed the global
vuex
types/vue.d.ts
files, and used the approach with Vue2.x
. Take a look at npm-patch-package. Then you can just comment out these lines and apply the patch. That's it, you can type the store in2.x
.I also like the idea that API and code stay the same, we just enhance typings.