What I want to do is to dynamically register a vuex module and call its action from within the fetch
method.
I tried to register my module in a separate file in the plugins
directory and then add it to the config. It didn't work at all, the store ignored my module completely (I imported the store in that file manually, perhaps that was the problem).
I also tried to do it in the beforeCreate
hook of my index component, using the this.$store
reference. This time it was registered successfully, but too late, since it wasn't available during the fetch
call.
Any ideas how to do it right?