怎么做加密货币网站,wordpress 多域名登陆,济南公司网站建设,郑州医院排名第一妇科uniapp 设置原生 tabBar 底部导航栏。
设置底部导航栏
一、创建页面#xff0c;一定要在 pages.json 文件中注册。 二、在 pages.json 文件中#xff0c;设置 tabBar 配置项。
pages.json 页面
{pages: [...],globalStyle: {...},uniIdRout…uniapp 设置原生 tabBar 底部导航栏。
设置底部导航栏
一、创建页面一定要在 pages.json 文件中注册。 二、在 pages.json 文件中设置 tabBar 配置项。
pages.json 页面
{pages: [...],globalStyle: {...},uniIdRouter: {...},// 其它配置...// 底部导航栏配置tabBar: {color: #555555, // 文字颜色selectedColor: #FF5050, // 选中文字颜色borderStyle: white, // 上边框颜色 white 白色backgroundColor: #FFFFFF, // 背景颜色list: [{pagePath: pages/a/a, // 页面路径text: 首页, // 按钮文字iconPath: /static/home.png, // 默认图片selectedIconPath: /static/home-active.png // 选中图片},{pagePath: pages/b/b, // 页面路径text: 攻略, // 按钮文字iconPath: /static/strategy.png, // 默认图片selectedIconPath: /static/strategy-active.png // 选中图片},{pagePath: pages/c/c, // 页面路径text: 发布, // 按钮文字iconPath: /static/issue.png, // 默认图片selectedIconPath: /static/issue.png // 选中图片},{pagePath: pages/d/d, // 页面路径text: 排行榜, // 按钮文字iconPath: /static/ranking.png, // 默认图片selectedIconPath: /static/ranking-active.png // 选中图片},{pagePath: pages/e/e, // 页面路径text: 我的, // 按钮文字iconPath: /static/my.png, // 默认图片selectedIconPath: /static/my-active.png // 选中图片}]}}效果 注在 list 中最少配置 2 个页面最多 5 个页面另外不能使用网络图片。
设置徽标
一、在任意页面中调用 uni.setTabBadge 方法设置指定页面的徽标。
templateview 首页 /view
/templatescriptexport default {// 其它配置项...mounted() {// 设置排行榜页面的徽标uni.setTabBarBadge({index: 3, // 页面下标text: 12, // text 的值必须是字符串})}}
/script效果 原创作者吴小糖
创作时间2024.1.11