wx.setTabBarBadge不能在wx.onSocketMessage里吗
发布于 4 年前 作者 panwei 3968 次浏览 来自 问答

wx.onSocketMessage(function (res) {console.log(‘收到服务器内容:’ + res.data)wx.setTabBarBadge({index: 2,text: ‘2’,complete: function (a) {console.log(a)}});})

报错:{errMsg: “setTabBarBadge:fail not TabBar page”}

1 回复

这里应该没有这个限制的,能否提供一下能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)?

回到顶部