In the previous article, we configured the wxss of the applet to achieve horizontal and vertical layout in the container component view. in this article, we use the swiper label to achieve image rotation. The round effect can be seen on many websites or mobile app terminals. in the small program, the swiper component is used to rotate images. the effect of today's small example is as follows: in the previous article, we configured the wxss of the applet to achieve horizontal and vertical layout in the container component view. in this article, we use the swiper label to achieve image rotation.
The round effect can be seen on many websites or mobile app terminals. in the small program, the swiper component is used to rotate images. the effect of today's small example is as follows:
To facilitate the demonstration, I adjusted the animation switching interval to 3 s, and the actual project is generally 5 s, depending on the project requirements.
The swiper slider view container component is used to implement image rotation. the page structure file code is as follows:
Ignore the parent container view and component attributes of the outermost layer. The structure of the page file is simplified as follows:
The code above shows that there is a swiper component in the code of the entire round chart, which consists of multiple swiper-item components. The swiper-item contains an image.
Is bound to an imgUrls array, and the component is repeatedly rendered using the data in the array. The block tag is not rendered on the page. For more information, see the official documentation:
Https://mp.weixin.qq.com/debug/wxadoc/dev/framework/view/wxml/list.html? T = 201715