为什么使用vuex会出现commit值为空?

小程序 文章 2022-03-11 09:40 614 0 全屏看文

AI助手支持GPT4.0

为什么使用vuex会出现commit值为空?Why does the commit value appear empty when using vuex?

为什么使用vuex会出现commit值为空?

调用 this.addToCart(goods)就会出现错误

有没有大佬帮忙看看的

Call this Addtocart (goods) will make mistakes. Do you have a boss to help

回答:

小黎:

这个写没有

.:

检查一下main.js中是否挂在了store

邦少:挂载啦store
.:应该是this.$store.commit('addToCart',goods)
VBit:

去uni社区提问

邦少:好的感谢

-EOF-

AI助手支持GPT4.0