当前位置:网站首页>小程序代码的构成
小程序代码的构成
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文件
是普通的功能模块文件,用来封装公共函数或属性供页面使用
边栏推荐
- Is it safe for CICC fortune to open an account online?
- JS implementation prohibits web page zooming (ctrl+ mouse, +, - zooming effective pro test)
- 如何形成规范的接口文档
- c语言oj得pe,ACM入门之OJ~
- 【数字IC验证快速入门】1、浅谈数字IC验证,了解专栏内容,明确学习目标
- 信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
- 信息学奥赛一本通 1340:【例3-5】扩展二叉树
- A way to calculate LNX
- Informatics Olympiad 1338: [example 3-3] hospital setting | Luogu p1364 hospital setting
- [quick start to digital IC Verification] 8. Typical circuits in digital ICs and their corresponding Verilog description methods
猜你喜欢

Convolution free backbone network: Pyramid transformer to improve the accuracy of target detection / segmentation and other tasks (with source code)

.Net分布式事務及落地解决方案

Leetcode skimming: binary tree 17 (construct binary tree from middle order and post order traversal sequence)

leetcode刷题:二叉树17(从中序与后序遍历序列构造二叉树)

如何形成规范的接口文档

Practical demonstration: how can the production research team efficiently build the requirements workflow?

About the priority of Bram IP reset

走入并行的世界

微信小程序正则表达式提取链接

Leetcode brush questions: binary tree 11 (balanced binary tree)
随机推荐
model方法
[C language] three implementations of quick sorting and optimization details
ByteDance dev better technology salon was successfully held, and we joined hands with Huatai to share our experience in improving the efficiency of web research and development
信息学奥赛一本通 1338:【例3-3】医院设置 | 洛谷 P1364 医院设置
leetcode刷题:二叉树18(最大二叉树)
2023年深圳市绿色低碳产业扶持计划申报指南
信息学奥赛一本通 1340:【例3-5】扩展二叉树
Informatics Olympiad 1337: [example 3-2] word search tree | Luogu p5755 [noi2000] word search tree
Is it safe for CICC fortune to open an account online?
Schema and model
c語言oj得pe,ACM入門之OJ~
BZOJ 3747 POI2015 Kinoman 段树
Bzoj 3747 poi2015 kinoman segment tree
19 mongoose modularization
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
信息学奥赛一本通 1339:【例3-4】求后序遍历 | 洛谷 P1827 [USACO3.4] 美国血统 American Heritage
强化学习-学习笔记4 | Actor-Critic
sun. misc. Base64encoder error reporting solution [easy to understand]
A solution to PHP's inability to convert strings into JSON
【c语言】快速排序的三种实现以及优化细节