If there are many computed properties which make use of state properties from the store, it will soon become very repetitive. To make a better developer experience, Vuex introduced the mapState helper function.
In the previous example, we use the return value of mapState as the value of computed property. But what happens when we have other computed properties? In this case, we need to copy its return value to the computed property list. For example:
When you project grows bigger and more complicated, there are more states in your single state tree, making it more difficult to maintain. It is a great idea to divide our store into modules. For example, you can create a file named store/user.js to save all the state related to user:
['firstName', 'lastName'] is an array of state property names from the user module that you want to map to computed properties in your component, they will be available in your component’s template as computed properties, we can also use them in other computed properties such as fullName.