赞
踩
官方文档:uni.setTabBarItem(OBJECT) | uni-app官网
动态设置 tabBar 某一项的内容
- uni.setTabBarItem({
- index: 0,
- text: 'text',
- iconPath: '/path/to/iconPath',
- selectedIconPath: '/path/to/selectedIconPath'
- })
- // pages.json
- {
- "tabBar": {
- "iconfontSrc":"static/iconfont.ttf",
- "list": [
- {
- "pagePath": "pages/index/index",
- "text": "Tab1",
- "iconfont": {
- "text": "\ue102",
- "selectedText": "\ue103",
- "fontSize": "17px",
- "color": "#000000",
- "selectedColor": "#0000ff"
- }
- }
- ]
- }
动态设置 tabBar 的整体样式
- uni.setTabBarStyle({
- color: '#FF0000',
- selectedColor: '#00FF00',
- backgroundColor: '#0000FF',
- borderStyle: 'white'
- })
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。