uni-app 之 tabBar 底部切换按钮

uni-app 之 tabBar 底部切换按钮

1693289945724.png

复制代码
{
    "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
        {
            "path": "pages/home/home",
            "style": {
                "navigationBarTitleText": "首页1",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/list/list",
            "style": {
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
        }
    ],
    "globalStyle": {
        // globalStyle全局设置、pages里面是单独的页面设置,如果页面没有设置就统一走全局设置
        "navigationBarTextStyle": "black",
        "navigationBarTitleText": "uni-app",
        "navigationBarBackgroundColor": "#F8F8F8",
        "backgroundColor": "#F8F8F8"
    },
    "uniIdRouter": {},
    // 底部切换按钮,核心代码其实就是下面的 "tabBar": { } 这一块,注意图片等资源一定要放在static文件夹下,否则会异常不展示
    "tabBar": {
        "selectedColor": "#1296db",
        "color": "#2c2c2c",
        "list": [{
                "text": "首頁",
                "pagePath": "pages/home/home",
                "selectedIconPath": "static/img/tabbar_home1.png",
                "iconPath": "static/img/tabbar_home2.png"
            },
            {
                "text": "列表",
                "pagePath": "pages/list/list",
                "selectedIconPath": "static/img/tabbar_ml1.png",
                "iconPath": "static/img/tabbar_ml2.png"
            }
        ]
    }
}

// 常用颜色

// d81e06 紅

// #f4ea2a 黃

// #1afa29 綠

// #1296db 藍

// #13227a 青

// #d4237a 紫

// #ffffff 白

// #2c2c2c 黑

相关推荐
A小辣椒1 天前
TShark:Wireshark CLI 功能
linux
A小辣椒2 天前
TShark:基础知识
linux
AlfredZhao2 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao2 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334662 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪3 天前
linux 拷贝文件或目录到指定的位置
linux
大树883 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠3 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
bush43 天前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行5203 天前
Linux 11 动态监控指令top
linux