const styles = {
inkbar: {
'&:after': {
backgroundColor: 'red',
height: '2px'
}
},
underline:{
'&:before':{
height:'2px',
backgroundColor:'green'
}
}
};
<Select
fullWidth
value={this.props.value}
onChange={this.props.onChange}
input={
<Input
classes={{
inkbar:this.props.classes.inkbar,
underline:this.props.classes.underline}}
/>
}
>
{this.props.children}
</Select>)
但是当我用反应工具检查代码时,我发现 <Input>
组件的类没有改变 . 有谁知道如何更改墨盒的颜色并在 <Select>
组件中加下划线?
我使用Material-ui v1.0.0-beta
我通过设置className来解决问题 . 但我仍然想知道为什么改变 class 不起作用 .
1 回答
而不是
classes
使用className
,有关详细信息,请查看此link