当前位置:网站首页>Private collection project practice sharing [Yugong series] February 2022 wechat applet -app Other properties of JSON configuration properties
Private collection project practice sharing [Yugong series] February 2022 wechat applet -app Other properties of JSON configuration properties
2022-06-11 13:55:00 【Yugong moving code】
One 、resizable
stay iPad The applet running on can be set to support screen rotation , stay PC Applet running on , The user can drag the window size in any proportion , You can also maximize the window in the applet menu .
app.json The configuration is as follows ;
{
resizable:true
}
- 1.
- 2.
- 3.
Two 、usingComponents
stay app.json Custom components declared in are regarded as global custom components , It can be used directly in a page or custom component within an applet without having to declare .
app.json The configuration is as follows ;
{
usingComponents:
' Global component path '
}
- 1.
- 2.
- 3.
3、 ... and 、permission
Applet interface permission related settings . Field type is Object.
app.json The configuration is as follows ;
{
"pages": [
"pages/index/index"],
"permission": {
"scope.userLocation": {
"desc":
" Your location information will be used to show the effect of the applet location interface "
// Continuous background positioning of Expressway driving
}
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
Four 、sitemapLocation
In the applet root directory sitemap.json This file is used to configure whether the applet and its page can be indexed by wechat , The content of the document is a JSON object , without sitemap.json , All pages are allowed to be indexed by default .
sitemapLocation The function of is to specify sitemap.json The path of
app.json The configuration is as follows ;
{
"pages": [
"pages/index/index"],
"sitemapLocation":
"sitemap.json"
}
- 1.
- 2.
- 3.
- 4.
5、 ... and 、style
"style": "v2" Indicates that a new version of the component style is enabled .
app.json The configuration is as follows ;
{
"style":
"v2"
}
- 1.
- 2.
- 3.
6、 ... and 、useExtendedLib
Specify the extension library to reference . At present, the following projects are supported :
- kbone: Multi terminal development framework
- weui: WeUI Component library
After designation , It is equivalent to introducing the latest version of the corresponding extension library npm package , At the same time, it does not occupy the package volume of the applet .
app.json The configuration is as follows ;
{
"useExtendedLib": {
"kbone":
true,
"weui":
true
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
7、 ... and 、entranceDeclare
Chat location messages are opened with a taxi applet , Details refer to .
app.json The configuration is as follows ;
"entranceDeclare": {
"locationMessage": {
"path":
"pages/index/index",
"query":
"foo=bar"
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
Page get message
//app.js
App({
onLaunch:
function (
options){
console.
log(
options)
var
scene
=
options.
scene
if (
scene
==
1146) {
// Location message scene value
var
location
=
options.
locationInfo
var
x
=
location.
latitude
var
y
=
location.
longitude
var
name
=
location.
name
}
},
})
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
8、 ... and 、darkmode and themeLocation
1.darkmode
stay app.json Middle configuration darkmode by true, This means that the current applet has been adapted to DarkMode, All basic components will display different default styles according to the system theme ,navigation bar and tab bar It will also switch automatically according to the following configuration .
2.themeLocation
Customize theme.json The path of , When configuring "darkmode":true when , Current profile is required .
{
"darkmode":
true,
"themeLocation":
"/path/to/theme.json"
}
- 1.
- 2.
- 3.
- 4.
Nine 、lazyCodeLoading
At present, only the value requiredComponents, On behalf of opening the applet 「 Inject... As needed 」 characteristic .
{
"lazyCodeLoading":
"requiredComponents"
}
- 1.
- 2.
- 3.
Ten 、singlePage
Now share with the circle of friends (Beta) After opening, it will enter single page mode
Single page mode related configuration
attribute | type | Required | The default value is | describe |
navigationBarFit | String | no | Auto adjust by default , If the original page is a custom navigation bar , Then for float, Otherwise squeezed | The intersection state between the navigation bar and the page , The value is float Indicates that the navigation bar is floating on the page , Intersect with page ; The value is squeezed Indicates that the page is squeezed by the navigation bar , Does not intersect the page |
11、 ... and 、embeddedAppIdList
Specify that the applet can pass through wx.openEmbeddedMiniProgram List of open applets .
{
"embeddedAppIdList": [
"wxe5f52902cf4de896"]
}
- 1.
- 2.
- 3.
Twelve 、halfPage
The full screen state of the first page uses a custom top , Support default / custom
{
"halfPage": {
"firstPageNavigationStyle":
"custom"
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
边栏推荐
- 折叠表达式
- Network information system emergency response
- d区间到可空转换
- create_ Error in engine MySQL connector encryption method
- 2022.2.28 variable length sequence table
- Microsoft exposes another "scandal": watching VR porn in the office, "the father of hololens" is about to leave!
- JDBC connection pool is used for batch import. 5million data are run each time, but various problems will occur in the middle
- Jdbctemplate data background management. I don't know why roleid is empty when adding users
- Unsealing easy QF PDA helps enterprises improve ERP management
- 阿里一面,谈谈策略模式在项目中的使用
猜你喜欢

Bs-xx-007 registered residence management system based on JSP

高比例风电电力系统储能运行及配置分析(Matlab实现)

Unsealing easy QF PDA helps enterprises improve ERP management

XXVIII - 3D point cloud real-time and offline generation of 2D grid and 3D grid map

Powerful full text search tool anytxt searcher

强大的全文本搜索工具——AnyTXT Searcher

阿里一面,谈谈策略模式在项目中的使用

Will Apple build a search engine?

代码对比工具,我就用这6个

可变参表达式
随机推荐
How to learn to spend money
Please, don't use enumeration types in external interfaces any more!
Hashicopy之nomad应用编排方案08(检测Job)
How to quickly make the title and ending with one click?
cadence SPB17.4 - group operation(add to group, view group list, delete group)
d的each与map不一致
Introduction to long connection
Why does each running Department display that the database already exists, delete the database, and then succeed? Each running department must delete the database, and re run the whole successfully
Today in history: Apple II comes out; Microsoft acquires gecad; The scientific and technological pioneer who invented the word "software engineering" was born
On the life extension of distributed locks -- redis based distributed locks
Will Apple build a search engine?
The application of machine learning in database cardinality estimation
全球手机市场衰退,连苹果也对iPhone14不抱过高期待
create_engine mysql connector加密方式报错
2022年甘肃省安全员B证考试题模拟考试题库及在线模拟考试
小米9线刷ROM
Business practice of volcano engine cloud database VEDB in bytes
[acwing 237. program automatic analysis] parallel search + discretization
Kubernetes certificate collection
Bs-xx-007 registered residence management system based on JSP