The basic display process of the second page list made today is as follows:
first realize yesterday’s click to jump
Introduce the carousel swiper
and then use the template (because it needs to be displayed dynamically)
Here you need to introduce a template. The introduction of wxml and wxss is different.
Inserting a template is to set the name, and use is wherever you want.
List rendering (to put it plainly is traversal)
This can add an identification key and
this can traverse multiple views.
Here I want to pass the data to the template. The three-point operator is used. Because there are item and index by default, just write it like this. This means that the official document says: Use the is attribute to declare the template to be used, and then pass in the data required by the template.
The three-point operator here is equivalent to destructuring assignment, and you can directly get the attributes in the object, so you can use it directly as follows.
Example: <image src="{
{avatar}}"></image>
Here the js file imported from the outside needs to be rolled back, otherwise an error is reported, it is calculated from the current position
Effect picture