uni-app配置了tabBar⽆法显⽰的问题{
"pages": [ //pages数组中第⼀项表⽰应⽤启动页,参考:uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "组件"
}
},
{
"path": "pages/index/index1",
"style": {
"navigationBarTitleText": "接⼝"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
selectediconpath什么意思"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
     //注意标红出,不要去改为相对路径,下⾯这个就是错误的⽰范,⽆法显⽰出tabBar "list": [{
"pagePath": "./pages/index/index",
"iconPath": "/static/1.png",
"selectedIconPath": "/static/2.png",
"text": "组件"
}, {
"pagePath": "./pages/index/index1",
"iconPath": "/static/3.png",
"selectedIconPath": "/static/4.png",
"text": "接⼝"
}]
}
}
修改之后:
{
"pages": [ //pages数组中第⼀项表⽰应⽤启动页,参考:uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "组件"
}
},
{
"path": "pages/index/index1",
"style": {
"navigationBarTitleText": "接⼝"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
     //要修改成与pages⾥⾯path的路径⼀样,点击保存就能正常显⽰了
"list": [{
"pagePath": "pages/index/index",
"iconPath": "/static/1.png",
"selectedIconPath": "/static/2.png",
"text": "组件"
}, {
"pagePath": "pages/index/index1",
"iconPath": "/static/3.png",
"selectedIconPath": "/static/4.png",
"text": "接⼝"        }]
}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。