
原来类组件的写法:
export default class Index extends Component {
  config = {
    navigationBarTitleText: '首页',
    navigationBarBackgroundColor: '#ffffff',
    backgroundColor: '#eeeeee',
    navigationBarTextStyle: 'black',
    backgroundTextStyle: 'light'
  }
  render () {
    return (
      <View className='index'>
      </View>
    )
  }
}如果是函数式组件需要换种写法:
function Index() {
  return (
    <View className='index'>
      <Text>1</Text>
    </View>
  )
}
Index.config = {
  navigationBarTitleText: '首页',
  navigationBarBackgroundColor: '#ffffff',
  backgroundColor: '#eeeeee',
  navigationBarTextStyle: 'black',
  backgroundTextStyle: 'light'
}
export default Index首发自:Taro 函数式组件配置页面参数 - 小鑫の随笔
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。