当前位置:网站首页>小程序代码的构成
小程序代码的构成
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文件
是普通的功能模块文件,用来封装公共函数或属性供页面使用
边栏推荐
猜你喜欢

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

Rainbond 5.7.1 支持对接多家公有云和集群异常报警

Solve the problem that the database configuration information under the ThinkPHP framework application directory is still connected by default after modification

无卷积骨干网络:金字塔Transformer,提升目标检测/分割等任务精度(附源代码)...
![[quick start of Digital IC Verification] 6. Quick start of questasim (taking the design and verification of full adder as an example)](/img/6d/110b87747f0a4be52da9fd49a05b82.png)
[quick start of Digital IC Verification] 6. Quick start of questasim (taking the design and verification of full adder as an example)

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

CTF逆向基础
![[quick start of Digital IC Verification] 9. Finite state machine (FSM) necessary for Verilog RTL design](/img/32/a156293f145417eeae8d93c539ca55.png)
[quick start of Digital IC Verification] 9. Finite state machine (FSM) necessary for Verilog RTL design

小程序页面导航
![Ros2 topic [01]: installing ros2 on win10](/img/46/550945aa36d2bec03e5dd29404f409.png)
Ros2 topic [01]: installing ros2 on win10
随机推荐
leetcode刷题:二叉树17(从中序与后序遍历序列构造二叉树)
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
Leetcode skimming: binary tree 12 (all paths of binary tree)
CCPC 2021威海 - G. Shinyruo and KFC(组合数,小技巧)
信息学奥赛一本通 1337:【例3-2】单词查找树 | 洛谷 P5755 [NOI2000] 单词查找树
[quick start of Digital IC Verification] 3. Introduction to the whole process of Digital IC Design
Model method
解决php无法将string转换为json的办法
618 "low key" curtain call, how can baiqiushangmei join hands with the brand to cross the "uncertain era"?
Practical demonstration: how can the production research team efficiently build the requirements workflow?
A solution to PHP's inability to convert strings into JSON
中金财富在网上开户安全吗?
About the priority of Bram IP reset
Process file and directory names
Cocos2d-x项目总结中的一些遇到的问题
sun. misc. Base64encoder error reporting solution [easy to understand]
Ffplay document [easy to understand]
sort和投影
小程序页面导航
【数字IC验证快速入门】6、Questasim 快速上手使用(以全加器设计与验证为例)