在uniapp项目中的根目录下找到pages.json文件夹:
{"pages": [ {"path": "pages/index/index","style": {"navigationBarTitleText": "index"}}],// 分包"subPackages": [{"root": "mail","pages": [{"path": "mail","style": {"navigationBarTitleText": "信箱"}}]} //最终地址: 根目录/mail/mail],"globalStyle": {"navigationBarTextStyle": "black","navigationBarTitleText": "11111","navigationBarBackgroundColor": "#F8F8F8","backgroundColor": "#F8F8F8"},"uniIdRouter": {}
}
分包预加载:
{// 分包预载配置"preloadRule": {// 当我们进入了pages/index/index页面以后就会预下载pages/subPack分包"pages/index/index": {"network": "all", //在指定网络下预下载,可选值为:all(不限网络)、wifi(仅wifi下预下载)"packages": ["pages/subPack"] //进入页面后预下载分包}}
}