# wx.setTabBarItem(Object object)
Start from base library version 1.9.0. Please remaining backward compatible.
with Promise style call: Supported
Need page permissions: Mini Programs cannot call this interface from a plugin page, and plugins cannot call the interface from the plugins page
Mini Program plugin: Not supported
Dynamic settings tabBar The content of an item,2.7.0
Temporary files and network files are supported.
# parameter
# Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
index | number | yes | tabBar Which one of those? From the left. | |
text | string | no | tab Button text on the | |
iconPath | string | no | Picture path, icon Size limit is 40kb, recommended size 81px * 81px, when postion for top This parameter is invalid when | |
selectedIconPath | string | no | Image path when selected, icon Size limit is 40kb, recommended size 81px * 81px When postion for top This parameter is invalid when | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
# sample code
wx.setTabBarItem({
index: 0,
text: 'text',
iconPath: '/path/to/iconPath',
selectedIconPath: '/path/to/selectedIconPath'
})