特牛生活网

获取Promise{<pending>}的值_promise{<pending>}的值怎么获取_Zhichao_97的博客-CSDN博客

网友收藏
文章浏览阅读2.8k次,点赞4次,收藏2次。问题:我使用如下代码let lyric = getLyric(this.$store.state.songId);console.log(lyric)获取到的结果:如果直接console.log(lyric.data),会输出undefined解决:let lyric = getLyric(this.$store.state.songId);let a = lyric.then((res)=>{ console.log(res.data)});._promise{}的值怎么获取