当前位置:网站首页>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
- Redis数据库的部署及常用命令
- Global and Chinese market of enterprise wireless LAN 2022-2028: Research Report on technology, participants, trends, market size and share
- [data recovery in North Asia] a data recovery case of raid crash caused by hard disk drop during data synchronization of hot spare disk of RAID5 disk array
- Using nocalhost to develop microservice application on rainbow
- Receiving package install and uninstall events
- Day 05 - file operation function
- Flowable source code comment (XXXIX) task listener
- Typeorm framework
- Worried about infringement? Must share copyrightless materials on the website. Don't worry about the lack of materials for video clips
猜你喜欢

LevelDB源码分析之LRU Cache

Using nocalhost to develop microservice application on rainbow

Series of improving enterprise product delivery efficiency (1) -- one click installation and upgrade of enterprise applications

Numeric amount plus comma; JS two methods of adding three digits and a comma to numbers; JS data formatting

Day 05 - file operation function

Unity project experience summary

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

C WPF uses dockpanel to realize screenshot box

tar命令

导电滑环使用的注意事项
随机推荐
Typeorm framework
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Use and principle of AQS related implementation classes
QT等待框制作
工业导电滑环的应用
Global and Chinese markets of superconductor 2022-2028: Research Report on technology, participants, trends, market size and share
tese_Time_2h
HDU - 1069 Monkey and Banana(DP+LIS)
数据库连接池的简单实现
Global and Chinese market of high-end home theater 2022-2028: Research Report on technology, participants, trends, market size and share
Ebpf cilium practice (2) - underlying network observability
printk 调试总结
What things you didn't understand when you were a child and didn't understand until you grew up?
Simple implementation of database connection pool
2/15 (awk, awk conditions, awk processing design can perform additional tasks, and use awk array +for loop to realize advanced search)
And search: the suspects (find the number of people related to the nth person)
云原生存储解决方案Rook-Ceph与Rainbond结合的实践
Set集合详细讲解
busybox生成的东西
Mathematical knowledge: finding the number of divisors