阅读(2034) 赞(0)

tt.setTabBarItem

2020-02-12 16:10:48 更新
基础库 1.44.0 开始支持,低版本需做兼容处理。

效果: 动态设置 Tab


参数

属性类型必填说明
indexnumber是左起第一个为 0
textstring否Tab 上的文字
iconPathstring否图片路径
selectedIconPathstring否选中时的图片路径
successfunction否接口调用成功的回调函数
failfunction否接口调用失败的回调函数
completefunction否接口调用结束的回调函数


示例代码

tt.setTabBarItem({
  index: 0,
  text: "text",
  iconPath: "/path/to/iconPath",
  selectedIconPath: "/path/to/selectedIconPath"
});