初学者想问一下为什么同样从接口里拿到的数据有的可以显示有的不行?

小程序 文章 2022-03-07 16:00 351 0 全屏看文

AI助手支持GPT4.0

初学者想问一下为什么同样从接口里拿到的数据有的可以显示有的不行?Beginners would like to ask why some of the data obtained from the interface can be displayed and some cannot?

初学者想问一下为什么同样从接口里拿到的数据有的可以显示有的不行?

我这里这个img就可以正常显示图片,title就是拿不到数据,是哪里的问题呢

The IMG here can display pictures normally. The title just can't get the data. What's the problem

回答:

八九:

打印下数据看看!

1:打印的数据发在下面了
八九:title赋值后是个数组,你能取到才有鬼了
1:那是要转换成.json的字符串格式吗
八九:数组你就遍历展示,对象才key取值。要是你数组只有一条,建议直接取第一个 title:res.data.data.bulletin[0]
1:感谢解答
1:

打印出来的数据是这样的

微喵网络:

res打印出来是什么样的?

1:打印的数据发在下面了

-EOF-

AI助手支持GPT4.0