当前位置:网站首页>小程序代码的构成
小程序代码的构成
2022-07-05 20:19:00 【'wx】
1.WXML模板
WXML和HTML的区别
(1).标签名称不同
HTML(div,span,img,a)
WXML(view,text,image,navigator)
(2)属性节点不同
<a href="#">超链接</a>
<navigator url="pages/home/home"></navigator>
(3)提供类似于vue的模板语法
数据绑定
列表渲染
条件渲染
2.WXSS样式
(1)新增了rpx尺寸单位,不同大小屏幕上面会自动进行换算
(2)提供了全局样式和局部样式
项目根目录下的app.wxss会作用于所有小程序页面
局部页面的.wxss样式仅对当前页面生效
(3)WXSS仅支持部分css选择器
类选择器和id选择器
元素选择器
并集选择器,后代选择器
伪类选择器
3.JS逻辑交互
(1)app.js
是整个小程序项目的入口文件,通过调用App()函数来启动整个小程序
(2)页面的.js文件
是页面的入口文件,通过调用Page()函数来创建并访问页面
(3)普通的.js文件
是普通的功能模块文件,用来封装公共函数或属性供页面使用
边栏推荐
- 插值查找的简单理解
- Summer Challenge harmonyos - realize message notification function
- 信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
- Leetcode skimming: binary tree 12 (all paths of binary tree)
- js方法传Long类型id值时会出现精确损失
- Elk distributed log analysis system deployment (Huawei cloud)
- 2022北京眼睛健康用品展,护眼产品展,中国眼博会11月举办
- sun. misc. Base64encoder error reporting solution [easy to understand]
- leetcode刷题:二叉树15(找树左下角的值)
- Informatics Olympiad 1337: [example 3-2] word search tree | Luogu p5755 [noi2000] word search tree
猜你喜欢
2022北京眼睛健康用品展,护眼产品展,中国眼博会11月举办
Leetcode brush question: binary tree 13 (the same tree)
leetcode刷题:二叉树13(相同的树)
CVPR 2022 | 常见3D损坏和数据增强
.Net分布式事务及落地解决方案
【愚公系列】2022年7月 Go教学课程 004-Go代码注释
Go language | 02 for loop and the use of common functions
关于BRAM IP复位的优先级
实操演示:产研团队如何高效构建需求工作流?
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
随机推荐
CTF reverse Foundation
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
Zero cloud new UI design
leetcode刷题:二叉树15(找树左下角的值)
如何形成规范的接口文档
Ffplay document [easy to understand]
Scala基础【HelloWorld代码解析,变量和标识符】
Bzoj 3747 poi2015 kinoman segment tree
炒股开户最低佣金,低佣金开户去哪里手机上开户安全吗
Leetcode brush questions: binary tree 18 (largest binary tree)
无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...
Leetcode brush questions: binary tree 11 (balanced binary tree)
JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)
C langue OJ obtenir PE, ACM démarrer OJ
[C language] merge sort
Document method
document方法
[quick start to digital IC Verification] 8. Typical circuits in digital ICs and their corresponding Verilog description methods
DP:树DP
Scala basics [HelloWorld code parsing, variables and identifiers]