【发布时间】:2021-02-04 13:49:46
【问题描述】:
当我使用 await 从 fetch 调用 2 个函数时,我遇到了在 fetch 挂钩 nuxt 中调用多个函数的问题。
async fetch() {
await this.fetchData();
await this.fetchData2();
},
methods: {
fetchData(lang) {
this.$store.dispatch('getData')
},
async fetchData2() {
let res = await api.getData2();
},
}
这是我在项目运行时使用的流程,出现错误
TypeError: Cannot read property 'toLowerCase' of undefined and TypeError: progress.start is not a function
我正在使用 nuxt 进度加载。请让我知道我做错了什么
【问题讨论】: