当前位置:网站首页>[wechat applet] 6.1 applet configuration file
[wechat applet] 6.1 applet configuration file
2022-06-12 14:32:00 【Blue warm fire】
List of articles
6.1 Applet configuration file
An applet application will include two basic configuration files .
One is global app.json Applet configuration | Wechat open documents (qq.com) And the page itself page.json
Be careful : Comments... Cannot appear in the configuration file
6.1.1 Global configuration app.json
pages Field —— Used to describe all page paths of the current applet , This is to let wechat customers know which directory your applet page is currently defined in
app. json Is the global configuration of the current applet , Including all the page paths of the applet 、 Interface performance 、 Network timeout 、 Bottom stab etc. .
Common quick start projects Inside app.json To configure
{
"pages":[
/* There are several sub pages in a few lines */
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
Tips @[email protected]
6.1.1.1 Create sub page method :
Right-click on the newly built


Code save
Source code
{ "pages":[ "pages/index/index", "pages/logs/logs" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "Weixin", "navigationBarTextStyle":"black" }, "style": "v2", "sitemapLocation": "sitemap.json" }Add a line of sub page code
{ "pages":[ "pages/index/index", "pages/logs/logs", /* Add this line of code */ "pages/demo02/demo02" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "Weixin", "navigationBarTextStyle":"black" }, "style": "v2", "sitemapLocation": "sitemap.json" }ctrl+s After the save

6.1.1.2 The relationship between the code line position and the page


6.1.1.3 window Field
Define the background color at the top of all pages of the applet , Text color definition, etc
1. navigationBarBackgroundColor( Navigation bar background color )
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
/* Navigation bar background color */
"navigationBarBackgroundColor": "#ffff",
"navigationBarTitleText": "weixin",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

take #ffff Change to #0094ff result :
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
/* Navigation bar background color */
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": "weixin",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

2. navigationBarTitleText( Navigation bar title text )
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
/* Navigation bar title text */
"navigationBarTitleText": "weixin",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

take weixin Change to My application result :
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
/* Navigation bar title text */
"navigationBarTitleText": " My application ",
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

3. navigationBarTextStyle( Navigation bar Title Color )
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
/* Navigation bar Title Color */
"navigationBarTextStyle":"black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

take black Change to white result :
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
/* Navigation bar Title Color */
"navigationBarTextStyle":"white"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

take white Change to yellow result :
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
/* Navigation bar Title Color */
"navigationBarTextStyle":"yellow" # Report errors
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

Thus note The contents of the error report can be obtained , Only color black and white
4. enablePullDownRefresh( Whether to enable global drop-down refresh )
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
"navigationBarTextStyle":"white",
/* Whether to enable global drop-down refresh */
"enablePullDownRefresh":true
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
effect :
5. backgroundTextStyle( The drop-down loading The style of )
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
/* The drop-down loading Color */
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
"navigationBarTextStyle":"white",
"enablePullDownRefresh":true
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

( Now pull down loading White ) take light Change it to dark result :
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
/* The drop-down loading Color */
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
"navigationBarTextStyle":"white",
"enablePullDownRefresh":true
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}

6. backgroundColor( Background color of window )
{
"pages":[
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"dark",
"navigationBarBackgroundColor": "#0094ff",
"navigationBarTitleText": " My application ",
"navigationBarTextStyle":"white",
"enablePullDownRefresh":true,
"backgroundColor":"#ff0000"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
effect :
边栏推荐
- Tu oses le croire? Il m'a fallu deux jours pour développer un système de gestion.
- Player actual combat 22 to solve the problems of flower screen and Caton
- 我愿称之为史上最全的深度学习面经总结(附答案详解)
- Recursive summary of learning function
- JD scanning code to obtain cookies
- Pay attention to click and pursue more users to enter the website. What bidding strategy can you choose?
- Three common methods of C language array initialization ({0}, memset, for loop assignment) and their principles
- Player actual combat 14 display YUV
- Copy word content to excel and automatically divide it into multiple columns
- Visual studio common shortcuts
猜你喜欢

Recursive summary of learning function

Player actual combat 21 audio and video synchronization

Player practice 26 adding slider and window maximization
![[Writeup]BUU SQL COURSE1[入门级]](/img/eb/1b2541b04ca231cb07f1f3706f51c7.png)
[Writeup]BUU SQL COURSE1[入门级]

Huawei equipment configuration BGP as number replacement

For cross-border e-commerce, the bidding strategy focusing more on revenue - Google SEM

Copy word content to excel and automatically divide it into multiple columns

MobileOne: 移动端仅需1ms的高性能骨干,你值得拥有!

TestEngine with ID ‘junit-vintage‘ failed to discover tests

Dynamic search advertising intelligent search for matching keywords
随机推荐
Three common methods of C language array initialization ({0}, memset, for loop assignment) and their principles
2022版Redis数据删除策略
新技术:高效的自监督视觉预训练,局部遮挡再也不用担心!
Player actual combat 13 create qtopengl project to promote window control and reload qoopenglwedge
ADB command (I) record
【OCR】AspriseOCR C# 英文、数字识别(中文不行)
Player actual combat 14 display YUV
Autofac初学(1)
Copy word content to excel and automatically divide it into multiple columns
Redis核心配置和高级数据类型
Vs2012: cannot assign a value of type 'char *' to an entity of type 'lpwstr'
ADB command (2) use monkey to test
Codeforces Round #798 (Div. 2)(A~D)
New technology: efficient self-monitoring visual pre training, local occlusion no longer need to worry!
Player actual combat 12 QT playing audio
华为设备配置OSPF伪连接
WinDbg preview debug analysis createtoolhelp32snapshot
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Player practice 11 audio resampling
Solve the problem that IEEE latex template cannot display Chinese