【发布时间】:2021-07-07 06:44:06
【问题描述】:
我尝试使用 async-await 在 typescript vue 3 上获取数据,但是当数据未定义时(或在函数调用工作之前),此函数已经控制台
private async exportDataOrder() {
await this.getDataExport() // function call
let data = await this.controller.exportOrderData // result function
if (data) {
console.log(data, 'dari vue')
console.log('waiting')
}
}
【问题讨论】:
-
您用
typescript标记了您的问题,类型会帮助我们帮助您。this.controller.exportOrderData是什么类型的?
标签: typescript asynchronous async-await vuejs3