How does Mini Program insert data dynamically?

how do users create and insert new data when requesting data? I think the data sent from the background will be added to the initial data data, and then re-setData ({}). But if the amount of data is large, such as the initial display of 20 pieces of data, the user will request it as soon as it is read, just like Weibo, when the data is wirelessly loaded to the end to request data, then the data data will become very large. Will there be any problem in going to setData ()? Mini Program can"t insert append dynamically like web. How do you solve it?

Mar.20,2021

every time you get the data, there will be no problem if the array is concatenated


you can directly spell the position you want to modify into a string, and then setData ({str: data})


    let count = goods[index].cartNum;
    countPP;
    this.setData({
      [count]: item
    })

    this.setData({
      ['shop.shopId']: d.shopId
    })

Menu