小程序tabBar底部菜单栏添加数量,列如购物车数量或者未读消息

wx.setTabBarBadge({ //tabBar右上角添加文本
    index: 2, //tabBar下标(底部tabBar的位置,从0开始)
    text: "3" //显示的内容,必须为字符串可通过JSON.toString()将number转为字符串
})

 

原文地址:https://www.cnblogs.com/liuqingxia/p/15715469.html