当前位置:网站首页>Summary of common components of applet
Summary of common components of applet
2022-07-01 05:31:00 【Front end Xiaobai is moving forward】
Common components of applets
Common view container class components
view
- Similar to HTML Medium
div
, It's aBlock-level elements
- Commonly used to achieve the layout effect of the page
- Normal view area
scroll-view
- Scrollable view area
It is often used to achieve the effect of scrolling lists
<scroll-view class="container1" scroll-y>
<view>A</view>
<view>B</view>
<view>C</view>
</scroll-view>
.container1 {
/* display: flex; justify-content: space-around; */
border: 1px solid #ccc;
width: 100px;
height: 120px;
}
.container1 view {
width: 100px;
height: 100px;
line-height: 100px;
text-align: center;
}
.container1 view:nth-child(1) {
background-color: lightgreen;
}
.container1 view:nth-child(2) {
background-color: blue;
}
.container1 view:nth-child(3) {
background-color: pink;
}
The effect is as follows :
swiper and swiper-item
The carousel chart container component and the carousel map item Components
<swiper class="swiper_container" indicator-dots indicator-color="#fff" indicator-active-color="gray" autoplay="true" interval="2000" circular>
<swiper-item>
<view class="item">A</view>
</swiper-item>
<swiper-item>
<view class="item">B</view>
</swiper-item>
<swiper-item>
<view class="item">C</view>
</swiper-item>
</swiper>
.swiper_container {
height: 150px;
}
.item {
height: 100%;
line-height: 150px;
text-align: center;
}
swiper-item:nth-child(1) .item {
background-color: green;
}
swiper-item:nth-child(2) .item {
background-color: rgb(68, 227, 248);
}
swiper-item:nth-child(3) .item {
background-color: rgb(233, 35, 134);
}
The effect is as follows :
Other commonly used components
button
- Button components
- Functional ratio HTML Medium button Rich buttons
- adopt open-type Attribute can call various functions provided by wechat ( Customer service 、 forward 、 Get user authorization 、 Access to user information, etc )
Simple demo:
<rich-text nodes="<h1 style='color:red'> title </h1>"></rich-text>
<view>~~~~~~~~ adopt type Specify the button type ~~~~~~~~</view>
<button> Ordinary button </button>
<button type="primary"> Main tone button </button>
<button type="warn"> Warning button </button>
<view>~~~~~~~ adopt size="mini" Small size buttons ~~~~~~~</view>
<button size="mini"> Ordinary button </button>
<button type="primary" size="mini"> Main tone button </button>
<button type="warn" size="mini"> Warning button </button>
<view>~~~~~~~plain Hollow button ~~~~~~~</view>
<button size="mini" plain> Ordinary button </button>
<button type="primary" size="mini" plain> Main tone button </button>
<button type="warn" size="mini" plain> Warning button </button>
image
- Picture components
- image The default width of the component is
300px
、 The height is240px
navigator( To be added )
- Page navigation component
- Be similar to HTML Medium a link
text
Text component , amount to html Medium
span
label , One of its propertiesselectable
It can achieve the effect of long press to select
rich-text
This text component has a property :
nodes
,nodes You can write some view labels in , And you can write some styles directly
<rich-text nodes="<h1 style='color:red'> title </h1>"></rich-text>
边栏推荐
- Printk debugging summary
- Receiving package install and uninstall events
- JS random verification code
- More than one file was found with OS independent path ‘lib/armeabi-v7a/libyuv.so‘.
- 担心侵权?必备无版权素材网站分享,不用担心视频剪辑缺素材
- Speed regulation and stroke control based on Ti drv8424 driving stepper motor
- Global and Chinese market of digital badge 2022-2028: Research Report on technology, participants, trends, market size and share
- Deeply understand the underlying implementation principle of countdownlatch in concurrent programming
- Understand several related problems in JVM - JVM memory layout, class loading mechanism, garbage collection
- 3D建模与处理软件简介 刘利刚 中国科技大学
猜你喜欢
Leetcode top 100 questions 1 Sum of two numbers
Application and principle of ThreadPoolExecutor thread pool
Chapitre d'apprentissage mongodb: Introduction à la première leçon après l'installation
Data consistency between redis and database
如何创建一个根据进度改变颜色的进度条
数据库连接池的简单实现
Go learning notes (5) basic types and declarations (4)
Use and principle of reentrantlock
How to create a progress bar that changes color according to progress
Numeric amount plus comma; JS two methods of adding three digits and a comma to numbers; JS data formatting
随机推荐
Typeorm framework
[RootersCTF2019]babyWeb
How to meet the requirements of source code confidentiality and source code security management
Set集合詳細講解
Copy baby prompt: material cannot be empty. How to solve it?
Unity project experience summary
One click deployment of highly available emqx clusters in rainbow
Simple implementation of database connection pool
Leetcode top 100 questions 1 Sum of two numbers
Common solutions for mobile terminals
Speed regulation and stroke control based on Ti drv8424 driving stepper motor
CockroachDB 分布式事务源码分析之 TxnCoordSender
LevelDB源码分析之LRU Cache
printk 调试总结
Introduction of 3D Modeling and Processing Software Liu Ligang, Chinese University of Science and Technology
SSGSSRCSR区别
vsCode函数注解/文件头部注解快捷键
工业导电滑环的应用
Practice of combining rook CEPH and rainbow, a cloud native storage solution
How to start learning editing? Detailed analysis of zero basis