企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
- 【强制】 当组件使用样式属性达到三个或者三个以上时,必须使用StyleSheet来创建样式属性并进行引用; ``` const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', marginTop:Common.scaleSize(10) } }); ``` - 【推荐】 当使用单一属性,或者全局样式属性时,推荐使用公共样式类; ``` // StyleCommon.js export default { topColor:{ backgroundColor: '#3A3D42', }, mainView:{ backgroundColor: '#12141B', }, }`在这里插入代码片` ``` - 【推荐】 当使用多个state或者props值时,推荐使用以下方式; ``` const {size, dotRadius, color} = this.props; const { maxNumber,minNumber,}=this.state; ``` 使用此方式,代码结构清晰简洁,便于维护;