网站技术分析

一点一滴的积累,一点一滴的沉淀!

微信小程序如何设置底部菜单栏(tab栏)

tabBar

如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。

1556434068(1).jpg



{

  "pages": [

    "pages/index/index",

    "pages/logs/logs",

    "pages/movie/movie",

    "pages/userinfo/userinfo",

    "pages/navigateTo/navigateTo"

  ],

  "window": {

    "backgroundTextStyle": "light",

    "navigationBarBackgroundColor": "#fff",

    "navigationBarTitleText": "我的小程序",

    "navigationBarTextStyle": "black",

    "navigationStyle": "default"

  },

  "tabBar": {

    "selectedColor": "green",

    "borderStyle": "white",

    "list": [

      {

        "pagePath": "pages/index/index",

        "text": "首页",

        "iconPath": "images/index.png",

        "selectedIconPath": "images/indexf2.png"

      },

      {

        "pagePath": "pages/movie/movie",

        "text": "电影",

        "iconPath": "images/movie.png",

        "selectedIconPath": "images/movief.png"

      },

      {

        "pagePath": "pages/logs/logs",

        "text": "图片",

        "iconPath": "images/image.png",

        "selectedIconPath": "images/imagef.png"

      },

      {

        "pagePath": "pages/userinfo/userinfo",

        "text": "个人中心",

        "iconPath": "images/center.png",

        "selectedIconPath": "images/centerf.png"

      }

    ]

  }

}


微信公众平台的详细讲解地址:https://developers.weixin.qq.com/miniprogram/dev/framework/config.html


打赏 支付宝打赏 微信打赏

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.5.2 Zero

蜀ICP备18016898;版权:2016 @陸仴 

Music