Is there any way to iterate over all Vuex modules? I registered my namespaced modules like this:
$store.registerModule('module-xyz', module);
Now is there any way to get the list of all of them?
It's undocumented, but you can get all modules through the _modules
property:
console.log(this.$store._modules.root._children);
You can also check for the existence of a module with hasModule
:
console.log(this.$store.hasModule('module-xyz'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With