{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回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在2025年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于 2025
  • 凌云舒语

    4人对此回答表示赞同

    是没有在TabBar页面调用api?麻烦给个相关的代码片段

    4
    2回复
    发布于 6年前

    评论(2)

    收起评论

    • Ezra 2019-02-01 00:07

      是的,目前的设计是这样的,后续也可以经过搜索找答案

      回复
    • 丛林人 2019-02-02 09:31

      是的,没有tabbar的页面不能调用吗?默认的组件是不是就没有角标的相关功能

      回复
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部