微信小程序API Tab Bar

参考官方文档:https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html

wx.showTabBarRedDot(Object object)

显示 tabBar 某一项的右上角的红点
 wx.showTabBarRedDot({
    index: 0
 })

wx.showTabBar(Object object)

显示 tabBar
 wx.showTabBar()

wx.setTabBarStyle(Object object)

动态设置 tabBar 的整体样式
 wx.setTabBarStyle({
   color: '#666666',
   selectedColor: '#ff4444',
   backgroundColor: '#ffffff',
   borderStyle: 'white'
 })

wx.setTabBarItem(Object object)

动态设置 tabBar 某一项的内容,2.7.0 起图片支持临时文件和网络文件
 wx.setTabBarItem({
  	index: 0,
    text: '修改',
    iconPath: 'images/1.png',
    selectedIconPath: 'images/2.png'
  })

wx.setTabBarBadge(Object object)

为 tabBar 某一项的右上角添加文本
wx.setTabBarBadge({
  index: 0,
  text: '99'
})

wx.removeTabBarBadge(Object object)

移除 tabBar 某一项右上角的文本
wx.removeTabBarBadge({
  index: 0
})

wx.hideTabBarRedDot(Object object)

隐藏 tabBar 某一项的右上角的红点
wx.hideTabBarRedDot({
  index: 0
})

wx.hideTabBar(Object object)

隐藏 tabBar
wx.hideTabBar()
发布了2 篇原创文章 · 获赞 2 · 访问量 66

猜你喜欢

转载自blog.csdn.net/Kancy_K/article/details/103961570