html52.com
我爱小程序-开发者交流社区

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": "我的"

}

]

}


网友回复

娇华:

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

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付