1在"pages/index/js"下改写 wx.switchTab 和跳转地址’/nav/index’
bindViewTap: function() {
wx.switchTab({
url: '/nav/index'
})
},
2 在app/json 中添加 “nav/index”, 和 “nav/index2”, 确定,保存 得到两个页面
"pages":[
"pages/index/index",
"nav/index",
"nav/index2",
3 预览https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html的自定义tabbar 把 custom-tab-bar 和image 两个文件夹黏贴到自己的项目中 黏贴到根目录下
4修改 custom-tab-bar /index.js
list: [{
pagePath: "/nav/index",
iconPath: "/image/icon_component.png",
selectedIconPath: "/image/icon_component_HL.png",
text: "组件"
和
{
pagePath: "/nav/index2",
iconPath: "/image/icon_API.png",
selectedIconPath: "/image/icon_API_HL.png",
5修改app.json
"pages/logs/logs"
],
"tabBar": {
"custom": true,
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "nav/index",
"iconPath": "image/icon_component.png",
"selectedIconPath": "image/icon_component_HL.png",
"text": "组件"
},
{
"pagePath": "nav/index2",
"iconPath": "image/icon_API.png",
"selectedIconPath": "image/icon_API_HL.png",
"text": "卡在那里"
}
]
},
"window":{
"backgroundTextStyle":"light",