在某些material-ui
组件中,我们有一个名为的道具color
。我们可以传递'default', 'inherit', 'primary', 'accent', 'contrast'
给它。但是我们可以为其传递自定义颜色吗?例如,我需要将按钮样式设置为红色。如果不是我的原色或强调色,该怎么办?
您可以只给按钮一个style={{backgroundColor: 'red'}}
,它将改变按钮的颜色。
<FlatButton label="My Colored Button" style={{backgroundColor: 'red'}} />
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句