res.data可以获取,但是再下面的数据无法获取?

小程序 文章 2021-03-19 18:21 2070 0 全屏看文

AI助手支持GPT4.0

res.data可以获取,但是再下面的数据无法获取?Res.data can be obtained, but the following data cannot be obtained?

res.data可以获取,但是再下面的数据无法获取?

console.log(res.data)可以在控制台显示数据,但是为什么console.log(res.data.num)不行呢?


console.log ( res.data )You can display data on the console, but why console.log ( res.data.num )Why not?

回答:

ZZQ:

跟着楼上的走,准没错

Samuel.Schnappi:

补补js基础 https://zh.javascript.info/

Riki:

res.data[0].num

站住、举手:

res.data是一个数组,你取里面的值需要加上下标 res.data[0].num

-EOF-

AI助手支持GPT4.0