簡體   English   中英

如何改變下划線顏色 <Select/>通過設置類

[英]How to change underline color of <Select/> by setting classes

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>)

但是當我使用react工具檢查代碼時,我發現<Input>組件的類沒有改變。 有誰知道如何更改墨盒的顏色和<Select>組件中的下划線?

我使用Material-ui v1.0.0-beta


我通過設置className來解決問題。 但我仍然想知道為什么改變班級不起作用。

而不是classes使用className ,有關更多信息,請檢查此鏈接

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM