收藏
回答

tabBar 角标设置失败

框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 工具 1 1

{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 个回答

登录 后发表内容