【发布时间】:2018-07-28 11:58:46
【问题描述】:
您好,我有这个创建和更新区域功能。 API调用成功后。我将再次回调 vuex 商店的调度。然后返回主区域页面。 问题是它需要大约 5 秒才能获得调度结果列表。使我的列表不更新。
在返回页面之前如何知道调度是否完成?
loadZones(){
this.$store.dispatch('getZones');
},
createOrUpdateZone(zone, region_checkbox, callback){
this.$http.post(process.env.API_URL +'/api/.....)
.then(res=> {
if(res.data.success == true){
this.loadZones();
this.$router.push('/zone');
} else{
this.has_error = true;
})
}
【问题讨论】:
标签: vue.js vuejs2 vuex dispatch