很多同学应该都知道 mapState 有以下三种写法: 不知道的童鞋可以查看本博客的 《vuex的mapState mapActions mapMutations mapGetters在模块module使用详解》 export default { computed: { ...mapState('pim', { count:
我们使用主要是为了简洁自己的代码, 没用这些方法之前我们的代码可能是这样的(这里用使用了modules的来举例子,没有module的使用更简单,这里的module为pim),mutation和action的使用方式一致就不单独举例子了。 export default { computed: { count(){ return this.$sto