1. 程式人生 > >小程式 tabBar右上角 加標誌 加數字提醒

小程式 tabBar右上角 加標誌 加數字提醒

顯示數字或文字

wx.setTabBarBadge({

 index: 4,

 text: ‘new’, //可改 

});

移除文字

wx.removeTabBarBadge({

 index: 4,

});

//加紅點

wx.showTabBarRedDot({

index: 4,

});

移除紅點

wx.hideTabBarRedDot({

index: 4,

});