uni-app 配置底部导航栏

uni-app About 586 words

配置代码

pages.json中新增tabBar节点,selectedColor指定选中后的文字颜色,list中指定各页面的pagePathiconPathtext

{
    "tabBar": {
        "color": "#7A7E83",
        "selectedColor": "#6f2a6f",
        "borderStyle": "black",
        "backgroundColor": "#ffffff",
        "list": [{
            "pagePath": "pages/home/home",
            "iconPath": "/static/nav_home.png",
            "text": "首页"
        }, {
            "pagePath": "pages/ls/index",
            "iconPath": "/static/nav_profile.png",
            "text": "我的"
        }]
    }
}

参考

https://uniapp.dcloud.net.cn/collocation/pages.html#tabbar

Views: 46 · Posted: 2025-07-26

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh