💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### tabBar 如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。 **Tip:** 1. 当设置 position 为 top 时,将不会显示 icon 2. tabBar 中的 list 是一个数组,**只能配置最少2个、最多5个 tab**,tab 按数组的顺序排序。 **属性说明:** | 属性 | 类型 | 必填 | 默认值 | 描述 | | --------------- | -------- | ---- | ------ | ---------------------------------- | | color | HexColor | 是 | | tab 上的文字默认颜色 | | selectedColor | HexColor | 是 | | tab 上的文字选中时的颜色 | | backgroundColor | HexColor | 是 | | tab 的背景色 | | borderStyle | String | 否 | black | tabbar上边框的颜色, 仅支持 black/white | | list | Array | 是 | | tab 的列表,详见 list 属性说明,最少2个、最多5个 tab | | position | String | 否 | bottom | 可选值 bottom、top | 其中 list 接受一个数组,数组中的每个项都是一个对象,其属性值如下: | 属性 | 类型 | 必填 | 说明 | | ---------------- | ------ | ---- | ---------------------------------------- | | pagePath | String | 是 | 页面路径,必须在 pages 中先定义 | | text | String | 是 | tab 上按钮文字 | | iconPath | String | 否 | 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片 | | selectedIconPath | String | 否 | 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效 | 如: ```json { "tabBar": { "list": [ { "pagePath": "pages/index/index", "text": "首页", "iconPath": "res/img/home.png", "selectedIconPath": "res/img/hover.jpg" }, { "pagePath": "pages/test/index", "text": "测试", "iconPath": "res/img/test.png", "selectedIconPath": "res/img/hover.jpg" } ], "color": "#666666", "selectedColor": "#0ffff0", "backgroundColor": "#ffffff", "borderStyle": "black", "position": "bottom" } } ``` :-: ![](http://xiaoyulive.oss-cn-beijing.aliyuncs.com/imgs/wechat/003.png) position: top 的情况,不能自定义图标 : :-: ![](http://xiaoyulive.oss-cn-beijing.aliyuncs.com/imgs/wechat/004.png)