uniapp动态改变底部tabBar和导航标题navigationBarTitleText

uniapp动态改变底部tabbar,和导航标题navigationBarTitleText

动态改变底部tabbar
uni.setTabBarItem({
    index: 0,
    text: this.i18n.tabs.home
});
导航标题navigationBarTitleText
uni.setNavigationBarTitle({
    title:this.i18n.user.title
});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
uniapp中跳转到底部tabBar可以使用uni.switchTab()方法。首先,在pages.json文件中添加tabBar配置,配置每个tab对应的页面路径和图标等信息。然后,在代码中使用uni.switchTab()方法进行跳转,传入对应的页面路径即可实现跳转到底部tabBar的功能。 在给定的引用中,pages.json文件中的配置如下: ```json "pages": [ { "path": "pages/index/index", "style": { "navigationBarTitleText": "分享" } }, { "path": "pages/read/read", "style": { "navigationBarTitleText": "阅读" } }, { "path": "pages/mine/mine", "style": { "navigationBarTitleText": "我的" } } ], "tabBar": { "color": "#7A7E83", "selectedColor": "#3cc51f", "borderStyle": "black", "backgroundColor": "#ffffff", "list": [ { "pagePath": "pages/index/index", "iconPath": "static/bottomTabBar/home2_icon.png", "selectedIconPath": "static/bottomTabBar/home1_icon.png", "text": "分享" }, { "pagePath": "pages/read/read", "iconPath": "static/bottomTabBar/readTrain2_icon.png", "selectedIconPath": "static/bottomTabBar/readTrain1_icon.png", "text": "阅读" }, { "pagePath": "pages/mine/mine", "iconPath": "static/bottomTabBar/mine2_icon.png", "selectedIconPath": "static/bottomTabBar/mine1_icon.png", "text": "我的" } ] } ``` 要跳转到底部tabBar的某个页面,可以使用uni.switchTab()方法,例如跳转到首页可以使用以下代码: ```javascript uni.switchTab({ url: '/pages/index/index' }); ``` 请问还有什么我可以帮助您的吗?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值