Closed Suruat closed 5 years ago
import 'vuex'
anywhere? It looks like a definition is missing.I'll try to see if I can get it working without needing to reference vuex anywhere.
const mappings = mapMutations(['setLastName']);
mappings.setLastName();
@Suruat #1 should be fixed in 0.1.5, and you won't have to use as any
.
One more question, if I may...
Is it possible to add type checking for this.$store.commit()
way of using?
I don't think that'll be possible anytime soon - there would need to be a few features added to TypeScript to get that to work.
Your best bet is to just use createHelpers and mapMutations from that to inject typesafe mutations into your Vue components.
Hi, I'm still getting this error in current version, any ideas?
I'm getting a curious error when using createHelpers
with local data
state: for whatever reason, having both local state methods
combined with mixed-in ...mapMutations
blows away the inferred type definitions for data
on this
within the local mutation. Any ideas?
store: store as any
shows me this message:When I try to use mutations,
last line (
setLastName()
) throws an error:Not sure, i it a problems with a package or I just using it wrong.