Is WeChat Mini Programs's request written in onLoad or onReady?

I have heard an elder say that request should be put in onReady and then request after rendering dom. I don"t know what advantage this will bring. Won"t it be slower than putting it in onload? Ask for answers from seniors


is usually placed in onload, and the data is obtained at the beginning of the page loading. If you need to return to this page and load the data, wrap it up and call it in onshow. Here's what I did


I don't think there is a fixed answer to this. It depends on your own needs. OnReady is not much slower than onLoad.

as for your elder's opinion, you'd better ask him.


it is better to put it in onload, where the request and rendering are carried out at the same time.


onShowonLoad
Menu