Briefly describe the routing concept of WeChat mini program

Briefly describe the routing concept of WeChat mini program

  • Whether it is nodejs express, koa, vue or react, including small programs, these application frameworks all contain a basic core concept, which is routing.
  • Routing in all application frameworks has commonality, mainly including: static routing table, allocation address, unified entrance, addressing and filtering.
  • Because the mini program mainly targets mobile applications, its routing operation is relatively simple. It is set through the pages node content in the app.json project global configuration file.
  • pages is a single array, the content of the array is routing address information, and the content of this array is the static route table concept in the routing concept.
  • The allocation address is the address set in pages, which corresponds to the directory and page pointed to by the address.
  • Because the content of the same mini program project is allocated by a global configuration file, the corresponding entry operation is unique.
  • You can use switchTab, reLaunch, redirectTo, navigateTo, and navigateBack to implement route navigation jump operations. The jump process is essentially the addressing process. The addressing process is the matching operation of the pointing address and the routing address.
  • Because the mini program page structure is relatively simple and users do not have to manually enter the page address, routing filtering operations such as 404 are not obvious.

That’s the end here, I hope it helps.

Guess you like

Origin blog.csdn.net/weixin_71893790/article/details/135187306