刚打开页面不是tabbar页面时,setTabBarItem报错怎么办?

发布于 5 年前作者 linxiuying3122 次浏览最后编辑 5 年前来自 ask

在app.js里使用了setTabBarItem改变tabbar图标,但是在刚打开不是tabbar页面的时候 报错:“errMsg”:“setTabBarItem:fail not TabBar page”。

请问有什么解决方法吗

1 回复
qiang36
qiang361 楼3 年前

请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。