当前位置:网站首页>Introduction to applet
Introduction to applet
2022-06-12 09:26:00 【Xiao Wei wants to learn from all the guys】
List of articles
Composition of applet code - WXML Templates
1. What is? WXML
2. WXML and HTML The difference between
Composition of applet code - WXSS style
1. What is? WXSS
2. WXSS and CSS The difference between
Composition of applet code - JS Logical interaction
1. In the applet .js file
2. Small program .js Classification of documents
Composition of applet code - WXML Templates
- What is? WXML
WXML(WeiXin Markup Language) It is a set of small program framework design Tag language , The structure used to build applet pages , Its function is similar to that in web page development HTML. - WXML and HTML The difference between
① Different label names
HTML (div, span, img, a)
WXML(view, text, image, navigator)
② Attribute nodes are different
Hyperlinks
③ Similar to Vue Template syntax in
Data binding
The list of rendering
Conditions apply colours to a drawing
aaa
aaa
div Label cannot wrap in applet
Composition of applet code - WXSS style
- What is? WXSS
WXSS (WeiXin Style Sheets) It's a set Style language , Used to describe WXML Component style , Similar to... In web development CSS. - WXSS and CSS The difference between
① Added rpx Unit of measure
CSS Pixel unit conversion needs to be carried out manually in , for example rem
WXSS Support new units of size at the bottom rpx, On screens of different sizes, the applet will automatically convert
② Provides global and local styles
In the project root directory app.wxss Will work on all applet pages
Of partial pages .wxss The style is only valid for the current page
③ WXSS Only partial CSS Selectors
.class and #id
element
Union selector 、 Descendant selector
::after and ::before Such as pseudo class selector
Of course you can put HTML and CSS Put it in the applet :
effect :
HTML( Put in WXML in ):
<!--pages/tsj/tsj.wxml-->
<button class="c-button c-button--gooey"> Hover me
<div class="c-button__blobs">
<div></div>
<div></div>
<div></div>
</div>
</button>
<svg style="display: block; height: 0; width: 0;" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<filter id="goo">
<feGaussianBlur result="blur" stdDeviation="10" in="SourceGraphic"></feGaussianBlur>
<feColorMatrix result="goo" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" mode="matrix" in="blur"></feColorMatrix>
<feBlend in2="goo" in="SourceGraphic"></feBlend>
</filter>
</defs>
</svg>
CSS( Put in WXSS in ):
/* pages/tsj/tsj.wxss */
/* From www.lingdaima.com */
.c-button {
color: #000;
font-weight: 700;
font-size: 16px;
text-decoration: none;
padding: 0.9em 1.6em;
cursor: pointer;
display: inline-block;
vertical-align: middle;
position: relative;
z-index: 1;
}
.c-button--gooey {
color: #06c8d9;
text-transform: uppercase;
letter-spacing: 2px;
border: 4px solid #06c8d9;
border-radius: 0;
position: relative;
transition: all 700ms ease;
}
.c-button--gooey .c-button__blobs {
height: 100%;
filter: url(#goo);
overflow: hidden;
position: absolute;
top: 0;
left: 0;
bottom: -3px;
right: -1px;
z-index: -1;
}
.c-button--gooey .c-button__blobs div {
background-color: #06c8d9;
width: 34%;
height: 100%;
border-radius: 100%;
position: absolute;
transform: scale(1.4) translateY(125%) translateZ(0);
transition: all 700ms ease;
}
.c-button--gooey .c-button__blobs div:nth-child(1) {
left: -5%;
}
.c-button--gooey .c-button__blobs div:nth-child(2) {
left: 30%;
transition-delay: 60ms;
}
.c-button--gooey .c-button__blobs div:nth-child(3) {
left: 66%;
transition-delay: 25ms;
}
.c-button--gooey:hover {
color: #fff;
}
.c-button--gooey:hover .c-button__blobs div {
transform: scale(1.4) translateY(0) translateZ(0);
}
Composition of applet code - JS Logical interaction
- In the applet .js file
It is not enough for a project to only provide interface display , In the applet , We go through .js File to handle user operations . for example : Respond to user clicks 、 Get the user's location and so on . - Small program .js Classification of documents
In the applet JS Documents fall into three broad categories , Namely :
① app.js
yes The entry file of the whole applet project , By calling App() function To start the whole applet
② Page .js file
yes Entry file for page , By calling Page() function To create and run the page
③ ordinary .js file
yes Common function module files , To encapsulate Public functions or properties For page use
边栏推荐
- DNA数字信息存储的研究进展
- ABC253F Operations on a Matrix
- Implementation of hotspot reference
- 存储研发工程师招聘
- Database common interview questions are ready for you
- Microservice gateway
- Mysql5.7 partition table
- 枚举所有USB设备代码
- Diff prime pairs
- II Transforming regular expressions into finite state automata: NFA state machine recognizes input strings
猜你喜欢

After receiving the picture, caigou was very happy and played with PDF. The submission format was flag{xxx}, and the decryption characters should be in lowercase

软件定义存储概览(一篇就够)

Black screen solution for computer boot
Automated test learning path, come and learn

【云原生】Eureka服务注册的搭建

《保护我们的数字遗产:DNA数据存储》白皮书发布

Auto.js学习笔记4:autojs打包后,大部分华为等大牌子手机无法安装?利用模拟器远程在autoPro里签名打包可以解决该问题。

网络层IP协议 ARP&ICMP&IGMP NAT

2026年中国软件定义存储市场容量将接近45.1亿美元
Common omissions in software test reports, give yourself a wake-up call
随机推荐
Leetcode689 wrong greedy thinking
How to write test cases?
SQL basic syntax II
Filters and listeners
Swagger documentation details
90%以上软件公司都会问的软件测试面试题赶紧来背吧
MySQL installation
DNA数字信息存储的研究进展
gnu-efi开发环境设置
软件测试报告中常见的疏漏,给自己提个醒
自动化测试学习路线,快来学吧
L1-019 who goes first
Mysql database ignores case
Database common interview questions are ready for you
MySQL index
小程序的介绍
Black screen solution for computer boot
Implementation of hotspot synchronized
I Regular expression to finite state automata: regular expression to NFA
测试用例和bug描述规范参考