In Nuxt, Vuex is already installed for you. You only need to be sure that the /store/ directory is present in the project root. If you are installing your Nuxt project using create-nuxt-app, this directory is autogenerated for you during project installation. In Nuxt, you can create your store in two different modes:
- Module
- Classic (deprecated)
Since the classic mode is deprecated, we will only focus on the module mode in this book. So, let's get started in the following section.
You can find the source code for all of the following Nuxt examples in /chapter-10/nuxt-universal/ in our GitHub repository.