Article From:https://www.cnblogs.com/ahongdepu/p/9061066.html

If you are fully in line with WeChat’s setData instructions, you can see that my view is not updated.

When you use setData, you modify the value of an object in data, and then the first layer of the object can not contain. number type

For example

this.setData({
  obj:{
    key1:1
  }
})

  This will cause problems, and the view layer will not be rendered.

But if it is second or deeper, it can be rendered.

this.setData({
  obj:{
    obj1:{
      key1:1
    }
  }
})

That’s all right.

If you have such a problem, you can try to change number to string. This is definitely a deep pit.

Leave a Reply

Your email address will not be published. Required fields are marked *