在使用wx:for的时候出现了Do not set same key \"NaN\" in wx:key.

去网上查看资料,说是使用wx:key

试了一下,没用

字面意思是不要设置同一个key,我去js里面查看我的item,

原来是这样写的,这种写法应该是把所有的user都set成了array[0].name

this.setData({
      user:array[0].name
    })

 正确写法

 this.setData({
      user:array
    })

 这样就不报错了

相关文章:

  • 2022-01-08
  • 2021-07-11
  • 2021-11-22
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2021-12-20
  • 2022-01-20
  • 2022-01-17
  • 2022-12-23
相关资源
相似解决方案