【发布时间】:2019-05-11 05:19:53
【问题描述】:
我正在尝试从这个调度中返回一些值
this.$store.dispatch('setValue', this.Value)
.then(response => {
console.log(response)
});
在我的 vuex 操作中,我有
.catch(error => {
if (error.response.status === 412) {
return "some message"
}
});
如何将错误传递回进行 vuex 调度的 .vue 文件?
【问题讨论】:
-
在 vuex 动作中使用 throw 错误。 }).catch((error) => { throw error})
标签: vue.js promise vuejs2 vuex