vueX多模块的正确使用方式

指定了命名空间的  才输入完整模块

默认不开命名空间的  直接写mutations里面的方法名就好 不用加模块名

//namespace:true
this.$store.dispatch("方法所在文件的名字/方法","提交的数据")
this.$store.dispatch("user/login",data)


//namespace:false 默认
this.$store.dispatch("方法","提交的数据")
this.$store.dispatch("login",data)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章