微信小程序之tabbar
2018-11-02 本文已影响4人
心情的蛊惑
之前学习了微信小程序怎么新建页面,现在来get下tabbar。
在这里我先建立了pages的同级文件夹images来存放图片。
然后在pages文件夹中建立两个页面,first,second。
最后在,app.json上编辑代码
{
"pages":[
"pages/first/first",
"pages/second/second",
"pages/index/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle":"black"
},
"tabBar": {
"list": [
{
"pagePath": "pages/first/first",
"text": "first",
"iconPath": "images/ka.png",
"selectedIconPath": "images/ning.png"
},
{
"pagePath": "pages/second/second",
"text": "second",
"iconPath": "images/文章.png",
"selectedIconPath": "images/猕猴桃.png"
}
]
}
}
