www说
其实有两种方式可以实现:方法一:async/await// actions.jsasync sendServerLoanCustomFilledDatas({commit}) { awiat fetch(`/api/xxx`);}// templateasync submit() { await this.$store.dispatch('sendServerLoanCustomFilledDatas', this.filledData); console.log(this.filledData.status);}方法二:组合Action核心就是在你的action中返回一个promise// actions.jssendServerLoanCustomFilledDatas({commit}) { return new Promise((resolve, reject) => { fetch(`/api/xxx`) .then(res => res.json()) .then(resData => { commit('xxxCommit', resData); resolve(); }) .catch(reject); });}// templatethis.$store.dispatch('sendServerLoanCustomFilledDatas', this.filledData).then(() => {});