1.在manifest配置以下节点,可以在App端启动分包。查看文档
"app-plus": { "optimization": { "subPackages": true }, "runmode" : "liberate" // 开启分包优化后,必须配置资源释放模式 }
一旦在pages.json里配置分包,小程序一定生效,而app是否生效,取决于manifest里是否开启。
2. 则需要在 pages.json 中填写,查看文档
{ "pages": [{ "path": "pages/index/index", "style": { ...} }, { "path": "pages/login/login", "style": { ...} }], "subPackages": [{ "root": "pagesA", "pages": [{ "path": "list/list", "style": { ...} }] }, { "root": "pagesB", "pages": [{ "path": "detail/detail", "style": { ...} }] }], "preloadRule": { "pagesA/list/list": { "network": "all", "packages": ["__APP__"] }, // "pagesB/detail/detail": { // "network": "all", // "packages": ["pagesA"] //} } }
标签:uniapp,style,...,微信,list,detail,分包,pages From: https://www.cnblogs.com/zhangyouwu/p/17547011.html