当前位置:网站首页>【更新中】微信小程序学习笔记_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可选值
啦啦啦
边栏推荐
- 2021-10-19
- Unity performance optimization
- Lua hot update basic grammar
- Usage of (case, when) in PostgreSQL
- Mutual call between Lua and C #
- [end of 2021] National Meteorological Short Video (Kwai, Tiktok) influence list in December
- E: Unable to locate package ROS melody desktop full
- [untitled]
- Product creation and commercial realization of chat robot (according to La Ma Bang - Dr. Wang Jingjing - speech)
- What does (+) in Oracle mean
猜你喜欢
Un système de gestion de centre commercial pour la conception de cours de technologie d'application de base de données
oracle 插入单引号
Zohocrm deluge function application time verification
ArrayList
Lua framwrok framework starts
Getting started with minicom
haproxy+keepalived搭建01
STM32F103 SPI (pit Diary)
*p++、*++p、++*p、(*p)++
How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
随机推荐
数据的存储
多旅行商问题——公式和求解过程概述
STM32F103 SPI (pit Diary)
Luaframwrok handles resource updates
go 解析身份证
How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
unity2019_ Input management
P2622 light off problem II (state compression search)
Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
Usage of (case, when) in PostgreSQL
E: 无法定位软件包 ros-melodic-desktop-full
Map的实现类的顺序性
Haproxy+kept cluster setup 02
Youyou1 of xlua knapsack system
Pulitzer Prize in the field of information graphics - malofiej Award
Unity2019_ Natural ambient light_ Sky box
Flex flexible box layout
Maxcompute string splitting function -split_ PART
LinkList
What is BFC?