vue store存儲commit 和dispatch

this.$store.commit('toShowLoginDialog', true); this.$store.dispatch('toShowLoginDialog',false)   主要區別是:異步 dispatch:含有異步操做,例如向後臺提交數據,寫法: this.$store.dispatch('mutations方法名',值)this commit:同步操做,寫法:this.$
相關文章
相關標籤/搜索