tabBar 角标设置失败
发布于 6 年前 作者 dcui 20405 次浏览 来自 问答

{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”: “我的”

}

]

}

1 回复

你好,是没有在TabBar页面调用api?麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部