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": ""
      }
    ]
  }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容