So far We have been using props to pass data through parent child chain in our vuejs apps. This can be still working, we can do these data transactions and state management in a much easier way.
What is a Vuex Store
Vuex store is state management module which helps developers to manage state of the object, and allow access data from any component through out the project.
How to add Vuex to Project
We can add Vuex to any project, by enabling the feature while creating new project or using Vue CLI as follows
vue add vuex
Under the store reside under the store folder, usually in index file. A Vuex store can be made of modules or it can be standalone store with following sections
- State – where data kept
- mutations – which change state
- Actions – methods which use state
- Getters – which can access state