When WeChat Mini Programs first entered the page, wx.showLoading did not display on the real machine.

my wx.showLoading is placed in the onload lifecycle function, and the wx.hideLoading is written in the request callback function, but it will be displayed when the simulator first enters the page. Why does it not appear on the phone?


onLoad and onReady are in order, but that time is almost negligible.

Picture from official document-Life cycle
clipboard.png


if the request is fast enough, you just can't see it. I don't think you should write it in the request callback, it should be written after rendering. You write this now, request to come back, and it hasn't been rendered to the page. Loading has gone down


simulator. There is a preview on the simulator. Do not hideLoading, the first wave of ShowLoading to see if you can see it, and then Hide

when you come out.
Menu