3π
β
Itβs completely up to you. I would store all domain related data (such as post tags, categories, posts itself) in dedicated module. But if i had another domain (for example products) i woluld create another module (products.js) that would have own tags, categories etc.
Thanks to Vuex
namespaced modules it would be clear which tags do you want to access:
// get post tags
this.$store.getters["post/tags"];
{ ...mapGetters("post", ["tags"]) }
// get products tags
this.$store.getter["products/tags"];
{ ...mapGetters("products", ["tags"]) }
π€Andrew Vasylchuk
Source:stackexchange.com