当前位置:   article > 正文

uniapp 多语言 动态修改tabBar标题_uniapp 动态tabbar 設置标题

uniapp 动态tabbar 設置标题
  1. "tabBar": {
  2. "color": "#BDBDBD",
  3. "selectedColor": "#1890FF",
  4. "borderStyle": "white",
  5. "backgroundColor": "#ffffff",
  6. "list": [{
  7. "pagePath": "pages/index/index",
  8. "iconPath": "static/images/tabbar_home_normal.png",
  9. "selectedIconPath": "static/images/tabbar_home_selected.png",
  10. "text": "%tabbar1%"
  11. },
  12. {
  13. "pagePath": "pages/active/index",
  14. "iconPath": "static/images/tabbar_order_normal.png",
  15. "selectedIconPath": "static/images/tabbar_order_selected.png",
  16. "text": "%tabbar2%"
  17. },
  18. {
  19. "pagePath": "pages/mine/index",
  20. "iconPath": "static/images/tabbar_mine_normal.png",
  21. "selectedIconPath": "static/images/tabbar_mine_selected.png",
  22. "text": "%tabbar3%"
  23. }
  24. ]
  25. },
  1. // 切换语言
  2. onLocaleChange(e) {
  3. uni.showModal({
  4. content: '确认更换字体?',
  5. success: (res) => {
  6. if (res.confirm) {
  7. uni.setLocale(e);
  8. uni.setTabBarItem({
  9. index: 0,
  10. text: this.$t('tabbar1')
  11. })
  12. uni.setTabBarItem({
  13. index: 1,
  14. text: this.$t('tabbar2')
  15. })
  16. uni.setTabBarItem({
  17. index: 2,
  18. text: this.$t('tabbar3')
  19. })
  20. }
  21. }
  22. })
  23. },

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/398410
推荐阅读
相关标签
  

闽ICP备14008679号