{errMsg: “setTabBarBadge:fail not TabBar page”}
代码如下
wx.setTabBarBadge({
index: 0,
text: ‘3’,
success: function (res){
console.log(res)
},
fail: function (res) {
console.log(res)
}
})
“tabBar”: {
“color”: “#666”,
“selectedColor”: “#dd524d”,
“borderStyle”: “black”,
“backgroundColor”: “#ffffff”,
“list”: [
{
“pagePath”: “pages/index/index”,
“iconPath”: “resources/images/icon/first.png”,
“selectedIconPath”: “resources/images/icon/first_se.png”,
“text”: “首页”
},
{
“pagePath”: “pages/cart/cart”,
“iconPath”: “resources/images/icon/cart.png”,
“selectedIconPath”: “resources/images/icon/cart_se.png”,
“text”: “购物车”
},
{
“pagePath”: “pages/mine/mine”,
“iconPath”: “resources/images/icon/mine.png”,
“selectedIconPath”: “resources/images/icon/mine_se.png”,
“text”: “我的”
}
]
}
你好,是没有在TabBar页面调用api?麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)