Configuring Vuex Library


Vuex provides that single source of truth for us. As we begin to store state within it, our state becomes a lot cleaner, and a lot easier to reason about. Now, every component that relies on our Global State can have direct access to it.

When one component updates the Vuex State, other components can be listening for when that State changes, then they can reactively respond based off that state-change (and the new State value they receive). For more details, see vuex's documentation

Now we will configure the Vuex library inside Vue application. So now first of all go to modules folder at VaahCms/Modules/Articles/Vue/store/modules/

Now make another file inside the module folder called as contents.js which will have the getters,actions,mutations as shown below

Let check the Vue/store/modules/contents.js

copy

Now this file will be import in Vue/store/store.js which is shown below.

copy