Vuex: Actions with same name in different modules.
I have a module names users and another roles, both modules in my Vuex have the action name setFilter, when i call this actions in my component everytime try to run the users module action. So, how can i say to my component that i want to run the roles module action.
This is how i'm calling the actions in my component.
I just dealt with this issue while my company rebuilds our current Rails application. I found namespacing each action, getter and mutation method to be the best solution. Let me know if you would like a real-world example... Our new platform is a full SPA using vue, vue-router, vuex, vuex-router-sync with a Laravel API backend.
@erikgall It would be great to see a real-world example if you could provide one. I am utilizing namespaces for my modules, but I am having trouble accessing the actions/getters within my components. Thanks!
@erikgall Yeah, i have already read this article, but i have the same problem of @cashlion. The article teach you how to create the namespacing, but don't show you how to get the actions and getter using mapGetters and mapActions.