当前位置:网站首页>Wechat applet | rotation chart
Wechat applet | rotation chart
2022-06-11 20:19:00 【gongsuochen】
WeChat official account :" Beauty of algorithm and programming ", Welcome to your attention , Learn more about this series article
Problem description
What is a rotation chart ?
Generally speaking, the rotation chart is in a module or window , Click with the mouse on the computer 、 Slide your finger on the phone , You can see multiple pictures . The location of the carousel map is usually placed at the beginning of the page , With eye-catching content 、 Highlight the key points . The carousel chart is often used for feature recommendation in general pages , For example, the rotation pictures on Taobao are all special offers and other good things . The rotation chart is in use , The most important feature is real-time update . The rotation chart in the small program also has the above characteristics .
Solution
Tags in applets :
WeChat Small program production and HTML Front end production is similar , The production process is also very similar , It's still a framework , Style modification , Feature set . But wechat applet is different from HTML The label is totally different , Wechat applet has its own writing tag . During the compilation of the rotation chart , The labels we often use are <view>、<swiper>、 <block>、<swiper-item>、<image>. One of the more important things is Swiper label , It is a slider container class component , Some of the following properties are provided .

chart 2.1 swiper Common properties
Production of rotation map :
After understanding the above basic knowledge , Combine what we have learned HTML Knowledge can start the production of the rotation map .Swiper Slider assembly code , have indicator-dots,autoplay,interval,duration Four properties .indicator-dots: Display panel indicator ( The default value is false)、autoplay: Auto switch or not ( The default value is false)、interval: Auto switch interval ( The default value is 5000)、duration: The length of the slide animation ( The default value is 500).
.wxml The code of the file is as follows :
<view> <!-- Shuffling figure --> <swiper indicator-dots='true' autoplay='true' interval='5000' duration='1000' circular='true'> <block wx:for="{{movies}}" wx:for-index="index"> <swiper-item> <image src='{{item.url}}' mode='aspectFill'></image> </swiper-item> </block> </swiper> </view> |
stay .wxss In file , We only need to set certain properties for the relevant tags . Because this time we are making a rotation chart , So the only relevant values are pictures . stay .js In file , Yes movies Assign a value to .
Page({ data: { inputValue: '', // Search content // Shuffling figure movies: [ { url: '../../images/s1.jpg' }, { url: '../../images/s2.jpg' }, { url: '../../images/s3.jpg' }, { url: '../../images/s4.jpg' } ], } }] |
The renderings are as follows :( The screenshot is incomplete )

chart 3.1 design sketch
END
Internship editor in chief | Wang Nanlan
responsibility Ed | Liu even
where2go The team
WeChat Number : Beauty of algorithm and programming

Long press identification QR code to follow us !
Write a message ” Comment , Looking forward to your participation !
边栏推荐
- STL container nested container
- 周鸿祎:想做直播带货抹不下面子 数据勒索成突出的安全威胁
- MySQL installation free configuration tutorial under Windows mysql-5.6.51-winx64 Zip version
- Final examination of theory and practice of socialism with Chinese characteristics 1
- In 2021, the global revenue of minoxidil will be about 1035million US dollars, and it is expected to reach 1372.6 million US dollars in 2028
- AHB2Standard_ handshake_ Bridge design
- 11 r create random number
- 电源防反接和防倒灌 - 使用MOS 管和运放实现理想二极管
- MySQL - transaction
- [Unity插件]着色器关键字分析工具ShaderControl
猜你喜欢
随机推荐
导师转我800块,让我仿真一个电路(电源设计)
Linux环境安装mysql数据库详细教程(含卸载和密码重置过程)
Volcano engine, Alibaba cloud and Tencent cloud jointly released the 'ultra low delay' live broadcast technical standard
模块八作业
unity package manager starting server stuck(Unity啟動卡在starting server,然後報錯)
First modelarts training
使用flask框架写挡板
29. Objet de localisation
Research and Analysis on the market status of polybutene-1 in China from 2021 to 2027 and forecast report on its development prospect
The tutor transferred me 800 yuan and asked me to simulate a circuit (power supply design)
MySQL - transaction
Leetcode 1992. 找到所有的农场组(可以,一次过)
Flutter doctor shows the solution that Xcode is not installed
These postgraduate entrance examination majors are easy to be confused. If you make a mistake, you will take the exam in vain!
Google proposed the super pre training model coca, and the accuracy of fine-tuning top-1 on Imagenet reached 91%! SOTA! On multiple downstream tasks
Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets
2022年最新宁夏建筑八大员(标准员)考试试题及答案
2022-2028 global and Chinese thermal ionization isotope mass spectrometer (TIMS) market status and future development trend
Zzulioj 2903: the power of warriors
2022-2028 global and Chinese thermocouple sensor market status and future development trend









