在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靜態(tài)配置
"tabBar": {
"color": "#000000",
"selectedColor": "#4ba22e",
"backgroundColor": "#f9dc4a",
"position": "bottom",
"list":[
{
"pagePath": "pages/index",
"text": "首頁",
"iconPath": "",
"selectedIconPath": ""
},
{
"pagePath": "pages/counter",
"text": "全局計數(shù)",
"iconPath": "",
"selectedIconPath": ""
}
]
}