1.微信小程序全局颜色一般在app.json中设置:
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/login/index",
"pages/coupn/index",
"pages/success/index",
"pages/wxOffList/index",
"pages/useCoupon/index",
"pages/failCoupon/index"
],
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light",
"navigationStyle": "custom"
}
2.单独设置就在自己的页面index.json中设置代码如下:
{
"usingComponents": {
"van-button": "/vant/button/index",
"van-cell-group": "/vant/cell-group/index",
"van-cell": "/vant/cell/index",
"van-field": "/vant/field/index",
"van-toast": "/vant/toast/index",
"van-dialog": "/vant/dialog/index",
"van-nav-bar": "/vant/nav-bar/index",
"van-tabbar": "/vant/tabbar/index",
"van-tabbar-item": "/vant/tabbar-item/index",
"van-icon": "/vant/icon/index"
},
"navigationBarTextStyle": "white"
}
直接在页面.json中加入 "navigationBarTextStyle": "white" 就行
我这里全局设的black色,在index页面设置的white颜色。