当前位置:网站首页>【更新中】微信小程序学习笔记_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可选值
啦啦啦
边栏推荐
- C#课程设计之学生教务管理系统
- Golang json格式和结构体相互转换
- One dimensional array two dimensional array (sort Max insert sort)
- 一条通往服务器所有端口的隧道
- [global product discovery 2] the first pure cloud augmented reality (AR) platform - Israel
- Base64 and base64url
- 一个实习生的CnosDB之旅
- Zohocrm deluge function application time verification
- JS common basic case sorting (continuous update)
- [cocos creator] get the resource UUID
猜你喜欢

Are you still watching the weather forecast on TV?

MAE

I want to do large screen data visualization application feature analysis

LwIP learning socket (application)

PostGIS space function

Transplantation of freetype Library

Base64 and base64url

Oracle queries grouped by time

Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does

WPF:解决MaterialDesign:DialogHost 无法关闭问题
随机推荐
Get to know unity2 for the first time
Oracle insert single quotation mark
oracle 插入单引号
Free use until 2015 -- viz artist multi touch plug-in package
Xlua task list youyou
C#课程设计之学生教务管理系统
Unity2019_ Natural ambient light_ Sky box
PIP uses image website to solve the problem of slow network speed
E: Unable to locate package ROS melody desktop full
Wechat native applet cloud development learning record 01
數據庫應用技術課程設計之商城管理系統
Compilation error: "not in executable format: file format not recognized"“
the installer has encountered an unexpected error installing this package
Scite change background color
Install cross compiler arm none liunx gnueabihf
Unity performance optimization
A tunnel to all ports of the server
Flex flexible box layout
一个实习生的CnosDB之旅
Map的实现类的顺序性