手把手教你搭建属于自己的小程序系列-------底部菜单栏

1 微信开发者工具下载地址

手把手教你搭建属于自己的小程序系列-------底部菜单栏

  • 下载安装如图

手把手教你搭建属于自己的小程序系列-------底部菜单栏

2搭建小程序底部菜单栏如图所示:

手把手教你搭建属于自己的小程序系列-------底部菜单栏手把手教你搭建属于自己的小程序系列-------底部菜单栏

3贴底部菜单栏代码

  • app.json 是当前小程序的全局配置,包括了小程序的所有页面路径、界面展示、网络超时时间、底部 tab 等。
  • pages字段 —— 用于描述当前小程序所有页面路径
  • window字段 —— 用于设置小程序的状态栏、导航条、标题、窗口背景色。
  • tabBar字段  —— 如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面

手把手教你搭建属于自己的小程序系列-------底部菜单栏

 

底部菜单栏代码

"tabBar": {

"color": "#b7b7b7",

"selectedColor": "#D4327A",

"borderStyle": "white",

"backgroundColor": "#f5f5f5",

"list": [

{

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

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

"selectedIconPath": "images/indexlight.png",

"text": "首页"

},

{

"pagePath": "pages/shop/shop",

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

"selectedIconPath": "images/shoplight.png",

"text": "购物"

},

{

"pagePath": "pages/my/my",

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

"selectedIconPath": "images/mylight.png",

"text": "我的"

}

]

}

4图标iconfont推荐阿里巴巴矢量图标库

地址:https://www.iconfont.cn/

是不是觉得小程序,超级简单,有木有很开心~~~

如果你有关关于微信小程序各种问题

请关注我个人微信号 V18069803206

我会尽我所能解答你的疑惑

手把手教你搭建属于自己的小程序系列-------底部菜单栏

5源码下载

链接:https://pan.baidu.com/s/1uafFyHLBjCow4WLPvDGsvA 
提取码:gd4j