wx:for读取不了数组,好像是数组的问题?

小程序 文章 2022-04-19 19:00 397 0 全屏看文

AI助手支持GPT4.0

wx:for读取不了数组,好像是数组的问题?wx:for can't read the array, it seems to be an array problem?

wx:for读取不了数组,好像是数组的问题?

console出来的数组不显示元素数量,但是数组有内容,wx:for也用不了。不知道该怎么办。。

The array produced by the console does not display the number of elements, but the array has content, and Wx: for is also useless. I don't know what to do..

回答:

拾忆:

百度了解一下 JS异步 问题吧

呜呜嘠:好的哥,我一共俩数据,但是这样的不知道为什么只能放进去一个。
用爱发电:
that.setData({  array_sign: res.data})
呜呜嘠:res.data不是我想放array_sign的东西,我用map通过res.data把想要的内容放到result里了,result有内容,但是不知道为什么用不了。。还请不吝赐教
闵仙森:

打印放到 setData的回调里大哥。

呜呜嘠:放到setData的回调,setData的回调是哪个啊,具体要咋操作哥。
呜呜嘠:数组里面有东西,但是wx:for用着没反应,,

-EOF-

AI助手支持GPT4.0