MpVue 微信小程序 动态修改导航标题、颜色

在script中直接调用方法即可
附 官方api 地址
https://developers.weixin.qq.com/miniprogram/dev/api/wx.setNavigationBarColor.html

      wx.setNavigationBarTitle({
        title: "chanegTitle"
      })
      wx.setNavigationBarColor({
        frontColor: "#000000",/*标题颜色,这里貌似仅支持 #ffffff 和 #000000 */
        backgroundColor: "00b26a",/*背景色 十六进制即可*/
        animation: {/*动画*/
          duration: 400,
          timingFunc: 'easeIn'
        }
      })

tabBar静态配置

"tabBar": {
    "color": "#000000",
    "selectedColor": "#4ba22e",
    "backgroundColor": "#f9dc4a",
    "position": "bottom",
    "list":[
      {
        "pagePath": "pages/index",
        "text": "首页",
        "iconPath": "",
        "selectedIconPath": ""
      },
      {
        "pagePath": "pages/counter",
        "text": "全局计数",
        "iconPath": "",
        "selectedIconPath": ""
      }
    ]
  }

你可能感兴趣的:(MpVue 微信小程序 动态修改导航标题、颜色)