mapGetters,mapActions,mapState,mapMutations
把vuex里面的各个模块的数据仓库 同步 异步 初始化都遍历到一起,方便多人合作 ,各自维护数据,但是 从代码上看不出是什么仓库

<template>
<div class="hello">
<h1>{{ msg }}</h1>
{{b}}{{q}}{{aa}}
<button @click="getValue(1)">点击</button>
<button @click="setAA">点击</button>
</div>
</template>

<script>
import {mapGetters,mapActions,mapState,mapMutations} from 'vuex'
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
},
computed:{
...mapState(['q','aa']),
...mapGetters(['b'])
},
methods:{
...mapActions(['getValue']),
...mapMutations(['setAA'])
},
mounted () {
console.log(this.b)
}
}
</script>