{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "home"
}
},
{
"path" : "pages/info/info",
"style" :
{
"navigationBarTitleText" : "info",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/about/about",
"style" :
{
"navigationBarTitleText" : "about",
"enablePullDownRefresh" : false
}
}
],
// 分包
"subPackages": [
{
"root": "sub", // 根目录下的子目录
"pages": [
{
"path": "index/index",
"style" :
{
"navigationBarTitleText" : "sub",
"enablePullDownRefresh" : false
}
},
{
"path": "detail/detail"
}
]
}
],
// 分包预加载
"preloadRule": {
"pages/info/info": { // 需要再那个页面进行预加载操作
"network": "all",
"packages": ["sub"] // root
}
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#4E5969",
"selectedColor": "#03C5BC",
"borderStyle": "black",
"backgroundColor": "#F8F8F8",
"list": [
{
"pagePath": "pages/index/index",
"text": "home"
},
{
"pagePath": "pages/info/info",
"text": "info"
},
{
"pagePath": "pages/about/about",
"text": "about"
}
]
},
"uniIdRouter": {}
}
- 在对应平台的配置下添加
"optimization":{"subPackages":true}
开启分包优化
定时器在页面卸载的同时清空定时器