uni.switchTab、uni.navigatevack()和uni.navigateTo()的区别
uni.switchTab() ===>是跳转到tabBar页面,并关闭其他非tabBar页面 ,经常用于跳转到首页
uni.navigateback() ===>关闭当前页面,返回上一页或多级页面
uni.navigatebackTo() ==>保留当前页面,跳转到应用里面的某个页面
什么是tabBar:
举例:app.json
{
"pages": [
"pages/index/index"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "aaaa",
"navigationBarTextStyle": "black"
},
"tabBar": {
"color": "#dadada",
"selectedColor": "#09bb07",
"backgroundColor":"#fff",
"borderStyle": "#f6f6f6",
"list": [
{
"pagePath": "pages/index/index",
"text": "存包"
},{
"pagePath": "pages/fetch/home/home",
"text": "取包"
},{
"pagePath": "pages/business/brand/brand",
"text": "商务合作"
},{
"pagePath": "pages/center/perCenter/perCenter",
"text": "个人中心"
}
]
}
}