November 2017
Beginner to intermediate
398 pages
8h 42m
English
Vuex provides a few helper functions to add state, getters, mutations, and actions. Since we should only use getters and actions in our components to help separate the state and related logic from the components, we will only use mapGetters and mapActions.
These functions generate appropriate computed properties and methods to the components that rely on the corresponding getters and actions from the store, so you don't have to type this.$store.getters and this.$store.dispatch each time. The argument is either:
For example, the following code using the array syntax:
mapGetters ...
Read now
Unlock full access