有个二维数组,如let arr = [[{id:1, age:10}, {id:2, age:12}],[{id:3, age:14}, {id:4,age:15}]],现用
<block wx:for="{{arr}}" wx:key="groupIndex" wx:for-index="groupIndex" wx:for-item="groupItem">
<block wx:for="{{groupItem}}" wx:key="id" wx:for-index="subIndex" wx:for-item="subItem">
<block>
<block>
在分页加载数据时,会有如下提示:[/__pageframe__/pages/tabFourth/tabFourth] Do not set same key \"[object Object]\" in wx:key.
想问第一层循环中的wx:key该如何设置(无论wx:key="*this",还是wx:key="groupIndex",都会报上面警告)
按理来说 wx:for-index="groupIndex" wx:key="groupIndex" 是正确的
wx:key="unique"
加个{{}}
那你就别设了,我有时候就不设,也不报警告