this.$store.commit('cart/setCart', {goods_id: this.goodsInfo.goods_id})//mutations
this.$store.dispath('cart/getCart', {goods_id: this.goodsInfo.goods_id})//actions
this.$store.getters['cart/total']//getters
this.$store.state.cart.cartInfo//state
// cart是模块modules之一
vue2通过this.$store访问vuex的方法
最新推荐文章于 2023-11-17 17:12:53 发布