uni.setTabBarItem(options)
介绍:
wx.setTabBarItem是不支持修改url路径的,所以使用uniapp的API。
动态设置 tabBar 某一项的内容:uniapp官网
setTabBarItem 兼容性:
Web | Android | iOS |
---|---|---|
4.0 | 3.91 | 4.11 |
参数:
options里的具体参数:
名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
---|---|---|---|---|---|
index | number | 是 | - | - | tabBar 的哪一项,从左边算起,索引从0开始 |
text | string | 否 | - | - | tab 上按钮文字 |