当前位置:网站首页>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
spanlabel , One of its propertiesselectableIt 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>

边栏推荐
- Simple read / write verification of qdatastream
- printk 调试总结
- QDataStream的簡單讀寫驗證
- 数据库连接池的简单实现
- Rust hello-word
- Chapitre d'apprentissage mongodb: Introduction à la première leçon après l'installation
- 使用 Nocalhost 开发 Rainbond 上的微服务应用
- TypeORM 框架
- Actual combat: gateway api-2022.2.13
- Global and Chinese markets for soft ferrite cores 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

Unity项目心得总结

Explanation of characteristics of hydraulic slip ring

Use and principle of AQS related implementation classes

Deeply understand the underlying implementation principle of countdownlatch in concurrent programming

Speed regulation and stroke control based on Ti drv8424 driving stepper motor

0xc000007b应用程序无法正常启动解决方案(亲测有效)

Summary of spanner's paper

Set集合详细讲解

And search: the suspects (find the number of people related to the nth person)

Design and application of immutable classes
随机推荐
Simple read / write verification of qdatastream
0xc000007b应用程序无法正常启动解决方案(亲测有效)
TypeORM 框架
Printk debugging summary
Set集合详细讲解
busybox生成的东西
移动端常用解决方案
[SRS] use of Vhost isolated stream: push / pull Stream Address
What things you didn't understand when you were a child and didn't understand until you grew up?
复制宝贝提示材质不能为空,如何解决?
LRU cache for leveldb source code analysis
[ffmpeg] [reprint] image mosaic: picture in picture with wheat
Use and principle of AQS related implementation classes
Day 05 - file operation function
Vérification simple de la lecture et de l'écriture de qdatastream
Thread process foundation of JUC
[Yugong series] February 2022 Net architecture class 005 ABP vNext Net core web application getting started configuration
导电滑环短路的原因以及应对措施
新手在挖财开通证券账户安全吗?
HDU - 1024 Max Sum Plus Plus(DP)