如何获取PromiseResult
Sonder
2021-07-29
343字
1分钟
浏览 (4.9k)
如何获取PromiseResult
解决:
getMeiriyiwen() {
return new Promise((resolve, reject) => {
$.get('https://interface.meiriyiwen.com/article/random?dev=1', res => {
resolve(res)
})
})
}
async mounted() {
let getMeiriyiwen = await this.getMeiriyiwen();
console.log(getMeiriyiwen,'getMeiriyiwengetMeiriyiwen')
}