【wx:for嵌套循环】第二层循环渲染出的数据为空值(NAN)?

小程序 文章 2022-02-08 11:20 455 0 全屏看文

AI助手支持GPT4.0

【wx:for嵌套循环】第二层循环渲染出的数据为空值(NAN)?[wx:for nested loop] The data rendered by the second layer of loop is null (NAN)?

【wx:for嵌套循环】第二层循环渲染出的数据为空值(NAN)?

渲染的数据结构如下:

这是一个只有两层的列表数据

WXML的代码如下:

就是一个简单的view里套了一个scroll-view组件

效果如下:

(WXSS略)

我的问题是:为什么第二层循环拿不到数据?或者拿到的数据是NAN?

The rendered data structure is as follows: This is a list data with only two layers. The code of wxml is as follows: a scroll view component is set in a simple view. The effect is as follows: (wxss omitted) my question is: why can't the second layer loop get the data? Or is the data obtained Nan?

回答:

xxxidream:

item-child 变量名不能用-

怀瑾:解决了 谢谢朋友
胡家内:二姨妈
xplee:

item-child -> itemChild 这样试试

-EOF-

AI助手支持GPT4.0