New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taro.setTabBarItem() h5不能用 #8580
Projects
Milestone
Comments
taro-bot2
bot
added
F-react
Framework - React
T-h5
Target - 编译到 H5
V-3
Version - 3.x
labels
Jan 25, 2021
tag:我3.0.25版本也不能用。。。。。 |
Taro 3.1.5 h5中的tarbar部分的函数都不可以使用, 因为它的tabconf从未被初始化,看代码可知, 需要调用 export function initTabBarApis (_App = {}) {
tabConf = _App.state.__tabs
App = _App
} |
Taro 3.1.5 我想使用
// app.ts
import intl from 'react-intl-universal';
...
...
class App extends Component {
onLaunch(opts) {
...
const app: any = Taro.getCurrentInstance().app;
const items: any = app.config.tabBar.list;
if (Array.isArray(items)) {
items[0].text = intl.get('a.title');
items[1].text = intl.get('b.title')
items[2].text = intl.get('c.title')
}
...
}
}
... 以上方法可以做到在runtime修改tabbar的文案, 图标和其他属性没有试过 |
ZakaryCode
added a commit
that referenced
this issue
Nov 15, 2021
ZakaryCode
added a commit
that referenced
this issue
Nov 15, 2021
3 tasks
Chen-jj
pushed a commit
that referenced
this issue
Nov 22, 2021
Chen-jj
pushed a commit
that referenced
this issue
Nov 22, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
H5
浏览器版本: Chrome 88.0.4324.104
使用框架: React
复现步骤
Taro.setTabBarItem()
期望结果
执行方法
实际结果
Uncaught (in promise)
{errMsg: "setTabBarItem:fail tabbar item not found"}
环境信息
The text was updated successfully, but these errors were encountered: