mpvue development of small micro-channel program Page "xx" has not been registered yet and can not set up a sub-page navigationBarTextStyle

Page “xx” has not been registered yet
  1. Normal Page Setup To configure the page files with folders on app.json, otherwise the program can not recognize.
  2. If pages, subPackagesin the configuration file are correct so pay attention, you need to run npm run buildto compile a small program. This configuration file and reload the page to normal
Page navigation sub-theme navigationBarTextStyle
  1. navigationBarTextStyle Set Nav Bar title color, only supports ·black / white
  2. If properly set up a sub-page json file navigationBarTextStylein any case it does not take effect that may use the official API to solve
wx.setNavigationBarColor({
  frontColor: '#ffffff',//前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000
  backgroundColor: '#ff0000',//背景颜色值,有效值为十六进制颜色
  animation: {//动画效果
    duration: 400,
    timingFunc: 'easeIn'
  }
})

It is worth noting that if you use mpvue framework development, normal code does not refresh sometimes then use npm run buildto recompile

Published 156 original articles · won praise 531 · views 110 000 +

Guess you like

Origin blog.csdn.net/qq_39043923/article/details/104988103