舒大少博客

一个95后少年的个人博客

当前时间为:
欢迎大家来到舒大少博客https://www.9713job.com,广告合作以及淘宝商家推广请微信联系15357240395

微信小程序之全局配置tabBar

2022-04-21 16:29:35
swq1822677238

手机扫码查看

微信小程序之全局配置tabBar
  1. 什么是tabBar
    tabBar 是移动端应用常见的页面效果,用于实现多页面的快速切换。
    小程序中通常将其分为:底部 tabBar、顶部 tabBar
    注意:tabBar 中只能配置 最少2个,最多5个tab页签,当渲染顶部 tabBar时,不显示 icon,只显示文本
  2. tabBar 的6个组成部分
  3. tabBar 节点的配置项
  4. 每个tab项的配置选项
    app.json:

    “tabBar”: {
        “list”: [
          {
            “pagePath”: “pages/home/home”,
            “iconPath”: “/images/home.png”,
            “selectedIconPath”: “/images/home-active.png”,
            “text”: “首页”
          },
          {
            “pagePath”: “pages/message/message”,
            “iconPath”: “/images/message.png”,
            “selectedIconPath”: “/images/message-active.png”,
            “text”: “消息”
          },
          {
            “pagePath”: “pages/contact/contact”,
            “iconPath”: “/images/contact.png”,
            “selectedIconPath”: “/images/contact-active.png”,
            “text”: “联系我们”
          }
        ]
      },

发表评论

邮箱地址不会被公开。 必填项已用*标注