Next step with Vuex : Module based Vuex

Introduction

Project Overview

Movies List

movies data movies.json

Movies Service

movies service movies.service.js

Users List

users list users.json

User Service

user service user.service.js

Users store file

user.js

Movies Store file

movies.js

Main store file

index.js

Namespacing

Login page

login.vue
loginFn function login.vue

Movies page

movies.vue
movies.vue

mapState

...mapState({
movies: state => state.MODULE_NAME.movies,
mostRatedMovies: state => state.MODULE_NAME.mostRatedMovies
})

mapGetters

...mapGetters({
a: 'MODULE_NAME/GETTERS_NAME',
a: 'MODULE_NAME/GETTERS_NAME',
})

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store