Taro 函数式组件配置页面参数 2021-05-02 12:46:55 学习笔记 125字 1分钟原来类组件的写法:12345678910111213141516export default class Index extends Component { config = { navigationBarTitleText: '首页', navigationBarBackgroundColor: '#ffffff', backgroundColor: '#eeeeee', navigationBarTextStyle: 'black', backgroundTextStyle: 'light' } render () { return ( <View className='index'> </View> ) }}如果是函数式组件需要换种写法:1234567891011121314151617function Index() { return ( <View className='index'> <Text>1</Text> </View> )}Index.config = { navigationBarTitleText: '首页', navigationBarBackgroundColor: '#ffffff', backgroundColor: '#eeeeee', navigationBarTextStyle: 'black', backgroundTextStyle: 'light'}export default Index 前一篇 css 自定义 ol/li 序号样式 后一篇vue 监听对象中某个属性的变化