小程序分包
- 底部tabBar要在主包
- 小程序项目目录
"subPackages":[
{
"root":"customerNo/",
"pages":[
{
"path": "greatOperation",
"style": {
"navigationBarTitleText": "导航名字1"
}
},
{
"path": "greatOperation_detail",
"style": {
"navigationBarTitleText": "导航名字2"
}
}
]
}
]
- 跳转
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)))
}