uni.removeTabBarBadge({
index: 2
})

- 发布:2025-05-24 10:03
- 更新:2025-05-24 10:09
- 阅读:35
产品分类: uniapp/小程序/微信
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win11 家庭中文
HBuilderX类型: 正式
HBuilderX版本号: 4.64
第三方开发者工具版本号: 2412050
基础库版本号: 3.7.11
项目创建方式: HBuilderX
示例代码:
操作步骤:
uni.removeTabBarBadge({
index: 2
})
uni.removeTabBarBadge({
index: 2
})
预期结果:
执行不出错
执行不出错
实际结果:
{"errMsg":"setTabBarBadge:fail not TabBar page"},
{"errMsg":"setTabBarBadge:fail not TabBar page"},
bug描述:
如果在tabber中使用uni.setTabBarBadge和uni.removeTabBarBadge都没有问题,但是要是进入到某张页面中,就会出错{"errMsg":"setTabBarBadge:fail not TabBar page"}。
感觉有点非人类了,我不能保证对用户发通知的时候,用户都会在tabber这几个页面当中。所以麻烦看看是那出了问题
8***@qq.com (作者)
我测试了,直接使用wx.setTabBarBadge({
index: 2,
text
})不会报错,但是没有效果。流程跑的都是一样,只是把uni替换成了wx
2025-05-24 10:34