在uni-app中,可以通过配置manifest.json文件来实现分包加载。以下是具体操作步骤:
"subPackages": [
{
"root": "pages/package1",
"pages": [
"page1",
"page2"
]
},
{
"root": "pages/package2",
"pages": [
"page3",
"page4"
]
}
]
// 以跳转到分包页面page3为例
uni.navigateTo({
url: '/pages/package2/page3'
})
注意事项: