How does the WeChat applet realize the list

Lists can be implemented in WeChat applets by using the "scroll-view" component or the "list" component.

  1. Use the "scroll-view" component: You can use the wx:for command to loop through the data in the list and set the corresponding style for each element.

  2. Use the "list" component: This component has built-in common list functions, including list rendering, pull-up loading, pull-down refresh, etc. Developers can directly use this component to implement list functions.

For example:

<scroll-view class="scroll-view" scroll-y="true">
  <view wx:for="{
      
      {
      
      list}}" class="list-item">
    {
      
      {
      
      item}}
  </

Guess you like

Origin blog.csdn.net/weixin_42609225/article/details/129609203