当前位置:网站首页>【更新中】微信小程序学习笔记_3
【更新中】微信小程序学习笔记_3
2022-07-03 08:13:00 【Miska_Muska】
【更新中】微信小程序学习笔记_3
自定义组件
创建组件
不同组件应存放单独目录
引用组件
根据使用频率进行选择。
局部
// page.json
{
"usingComponents": {
"my-test": "/components/test/test"
}
}
// wxml
<my-test></my-test>
全局
// app.json
组件VS页面
组件样式
- 隔离性
隔离性仅作用于class选择器,此时组件使用app.wxss样式无效
应在组件/组件应用页面使用class选择器,不要使用id/属性/标签选择器!
修改隔离选项
// component.js
Component({
options: {
"styleIsolation": 'isolated'
}
})
// OR component.json
{
"styleIsolation": "isolated"
}
sytleIsolation可选值
啦啦啦
边栏推荐
- Mutual call between Lua and C #
- The general trend of data news releases the power of visual reporting ----- essays after reading
- Idea dereference display effect
- oracle 插入单引号
- Demonstration of plug-in use of ventuz basic series
- [USACO12MAR]Cows in a Skyscraper G(状态压缩dp)
- Basic operation and process control 2
- 【cocos creator】点击按钮切换界面
- 一条通往服务器所有端口的隧道
- 链式长取值
猜你喜欢
Install cross compiler arm none liunx gnueabihf
Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
Xlua task list youyou
vcs import src < ros2. Repos failed
Iterm2 setting
Un système de gestion de centre commercial pour la conception de cours de technologie d'application de base de données
多旅行商问题——公式和求解过程概述
Scite change background color
CLion-Toolchains are not configured Configure Disable profile问题解决
Haproxy+kept build 01
随机推荐
链式长取值
About Wireshark's unsuccessful installation of npcap
C#课程设计之员工信息管理系统
The difference between hdmi2.1 and hdmi2.0 and the conversion of PD signals.
animation
Get to know unity2 for the first time
Clip Related Script
Storage of data
Initial unity
L'installateur a été installé avec une erreur inattendue
Shader foundation 01
jupyter远程服务器配置以及服务器开机自启
2021-10-19
使用 FileChannel 进行文件的复制拷贝
Basic operation and process control
数据库应用技术课程设计之商城管理系统
Unity dotween sequence animation replay problem.
What is BFC?
How to configure GDAL under idea
JS to implement publish and subscribe