欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 高考 > 【微信小程序】tabBar全局配置

【微信小程序】tabBar全局配置

2025/2/25 15:01:34 来源:https://blog.csdn.net/2301_77699699/article/details/145567271  浏览:    关键词:【微信小程序】tabBar全局配置

 一、tabBar的组成成分

属性类型必填默认值描述
colorHexColortab 上的文字默认颜色,仅支持十六进制颜色
selectedColorHexColortab 上的文字选中时的颜色,仅支持十六进制颜色
backgroundColorHexColortab 的背景色,仅支持十六进制颜色
borderStylestringblacktabbar 上边框的颜色, 仅支持 black / white
listArraytab 的列表,详见 list 属性说明,最少 2 个、最多 5 个 tab
positionstringbottomtabBar 的位置,仅支持 bottom / top

二、list属性

属性类型必填说明
pagePathstring页面路径,必须在 pages 中先定义
textstringtab 上按钮文字
iconPathstring图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
当 position 为 top 时,不显示 icon。
selectedIconPathstring选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
当 position 为 top 时,不显示 icon。

更多信息:全局配置 | 微信开放文档 

三、示例 

"tabBar": {"selectedColor": "#f3514f","color": "#666","backgroundColor": "#efefef","borderStyle":"black","position":"bottom","list": [{"text": "首页","pagePath": "pages/index/index","iconPath": "/image/first_page.png","selectedIconPath": "/image/active_fp.png"},{"text": "分类","pagePath": "pages/classify/classify","iconPath": "/image/classify.png","selectedIconPath": "/image/active_classify.png"},{"text": "购物车","pagePath": "pages/car/car","iconPath": "/image/buy_car.png","selectedIconPath": "/image/active_car.png"},{"text": "我的","pagePath": "pages/me/me","iconPath": "/image/me.png","selectedIconPath": "/image/active_me.png"}]},

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词