当前位置:网站首页>[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 :
边栏推荐
- C secret arts script Chapter 5 (structure) (Section 1)
- Simple code implementation of addition, subtraction, multiplication and division calculator
- 对某热水软件的加密参数逆向
- Mobileone: the mobile terminal only needs 1ms of high-performance backbone. You deserve it!
- Player actual combat 14 display YUV
- Common DOS commands
- Huawei equipment configuration BGP as number replacement
- Software package for optimization scientific research field
- C secret script Chapter 3 (detailed explanation of string function) (Section 1)
- And, or, not equal, operator
猜你喜欢

华为设备配置H虚拟专用网

完美收官|详解 Go 分布式链路追踪实现原理

QT realize picture dragging

Configuring OSPF pseudo connection for Huawei devices

Appnium (II) installation and basic use of mitmproxy
![[Writeup]BUU SQL COURSE1[入门级]](/img/eb/1b2541b04ca231cb07f1f3706f51c7.png)
[Writeup]BUU SQL COURSE1[入门级]

Getting started alicloud haas510 open board DTU (version 2.0) --510-as

Leetcode 2185. Counts the string containing the given prefix

高考回忆录

How to use Android studio to create an Alibaba cloud Internet of things app
随机推荐
Player practice 20 unpacking thread
面向优化科学研究领域的软件包
Introduction to functions (inline functions and function overloading)
C语言中主函数调用另外一个函数,汇编代码理解
Simple code implementation of addition, subtraction, multiplication and division calculator
Player practice 19 xaudio turn on audio
Two methods of implementing asynchronous calling function with QT
Location (I) error: command erred out with exit status
使用make方法创建slice切片的坑
ADB command (I) record
华为设备配置H虚拟专用网
Perfect ending | detailed explanation of the implementation principle of go Distributed Link Tracking
Basic usage of scanner
JS (II) syntaxerror: cannot use import statement outside a module
Llvm pass-- virtual function protection
JD scanning code to obtain cookies
Introduction to QT reflection mechanism and signal slot mechanism
Details of bypassing safeseh mechanism by using modules that do not enable safeseh
QT to realize the simple use of SQLite database
Autofac初学(1)