Build an Online Shop with Vue And Laravel Part 8.1 - Implement Vuex

Alfian Ardhi
2 min readNov 20, 2021
Photo by Hennie Stander on Unsplash

After learn how to call API, in this article we will learn how to implement vuex as state management to Vue.js project. If you are have been playing with vuejs then you have probably come across vuex, if not then here is what it is.

What is Vuex

Vuex is a state management library that can help us manage the state of our applications. Instead of multiple components handling state locally and passing them to the required components, we can use Vuex to manage state for the entire application in one location.

It’s the best used with Vuejs, but is not limited for Vuejs. We can use it with Reactjs.

Chapters

For this article, I will provide repository links

Pre-request

To follow along with this article, you will need to read vuex documentation and how to separating state management by gitlab development docs.

Vuex File structure

Separate these concerns into different files to improve readability,

Vuex Structure

In my next article, I’ll explain how to implement vuex mutations, actions and getters in these apps series.

Thank you.

--

--