当前位置:网站首页>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
边栏推荐
猜你喜欢
What are the software testing requirements analysis methods? Let's have a look

001:数据湖是什么?

Implementation of hotspot reference
Selenium面试题分享

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

JVM virtual machine

电阻的作用有哪些?(超全)

Swagger documentation details

Distributed transaction solution 1: TCC (compensation transaction)

Filters and listeners
随机推荐
ThreadLocal
Practical SQL statements and execution plan view
Implementation of hotspot reference
Cookies and sessions
Multi table operation instance
QQ,微信能聊天都靠它(socket)?
Visualization of two-dimensional feature logistic regression prediction results
gnu-efi开发环境设置
003:AWS认为什么是数据湖?
Database common interview questions are ready for you
枚举所有USB设备代码
90%以上软件公司都会问的软件测试面试题赶紧来背吧
Several ways to restart kubernetes pod
电阻的作用有哪些?(超全)
Common omissions in software test reports, give yourself a wake-up call
APP测试面试题汇总,面试必考一定要看
Record and store user video playback history selection
ADB命令集锦,一起来学吧
++ problems in C language
Implementation of hotspot synchronized