小程序发行代码大于2M做分包处理

小程序分包

  • 底部tabBar要在主包
  • 小程序项目目录
    小程序发行代码大于2M做分包处理_第1张图片
    小程序发行代码大于2M做分包处理_第2张图片
"subPackages":[
		{
			"root":"customerNo/",
			"pages":[
				{
					"path": "greatOperation",
					"style": {
						"navigationBarTitleText": "导航名字1"
					}
				},
				{
					"path": "greatOperation_detail",
					"style": {
						"navigationBarTitleText": "导航名字2"
					}
				}
			]
		}
	]

小程序发行代码大于2M做分包处理_第3张图片

  • 跳转
uni.navigateTo({
	url: '../../customerNo/greatOperation'
})
//主页tabBar跳转
uni.switchTab({
	url: '../index/index'
})
//带参跳转
uni.navigateTo({
	url: '../../customerNo/greatOperation?item='+encodeURIComponent(JSON.stringify(item))
})
//接参
onLoad(e) {
	console.log(JSON.parse(decodeURIComponent(e.item)))
}

你可能感兴趣的:(wx)