[vue日志]vue store 存储 dispatch 和 commit的区别

dispatch: 含有异步操做 存储: this.$store.dispatch('initUserInfo',friend); 取值: this.$store.getters.userInfo; commit:同步操做 存储: this.$store.commit('initUserInfo',friend); 取值: this.$store.state.userInfo;
相关文章
相关标签/搜索