WeChat Mini Program-Performance and Experience Optimization

  • Reasonably set the size of the influence area of ​​clickable elements
  • Avoid taking too long to render pages
  • Avoid taking scripts too long

 

  • Do the necessary caching for network requests to avoid redundant requests
  • Don't introduce unused wxss styles
  • The color of the text is matched with the background color. The general artist has designed it.

 

  • It is recommended to use https for all resource requests
  • Do not use obsolete interfaces
  • Avoid too many WXML nodes
  1. One page has less than 1000 WXML nodes
  2. Node tree depth is less than 30 layers
  3. No more than 60 child nodes
  • Avoid packaging pages that cannot be accessed into small programs
  • Timely recycling timer
  • Avoid using: active pseudo class to achieve click state

 

  • In the scroll area, you can turn on the inertial scrolling enhanced experience. On IOS: -webkit-overflow-scrolling: touch Android defaults to
  • Avoid any JavaScript exceptions
  • All requests respond normally

 

  • All requests should not take too long
  • Avoid making too many image requests in a short time
  • Avoid making too many requests in a short time

 

 

  setData optimization

  • Avoid setData data is too large, no more than 1M
  • Avoid setData calls too frequently
  • Avoid passing variables that are not bound to WXML into setData

 

Guess you like

Origin www.cnblogs.com/lxz-blogs/p/12703745.html