Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Material ui Can';t使用材质ui中的类替代样式_Material Ui - Fatal编程技术网

Material ui Can';t使用材质ui中的类替代样式

Material ui Can';t使用材质ui中的类替代样式,material-ui,Material Ui,我花了很长时间试图了解如何更改样式以一次性使用TextField 这些文件对我来说真的毫无意义 <FormControl> <InputLabel htmlFor="mobile-number-input" > Mobile Number </InputLabel> <Input value={this.state.mobileNumber} onChange={this.onMobileNumberCha

我花了很长时间试图了解如何更改样式以一次性使用
TextField

这些文件对我来说真的毫无意义

<FormControl>
  <InputLabel
    htmlFor="mobile-number-input"
  >
    Mobile Number
  </InputLabel>
  <Input
    value={this.state.mobileNumber}
    onChange={this.onMobileNumberChange}
    fullWidth
    classes={{
      inkbar: {
        '&:after': {
          backgroundColor: 'white',
        }
      }
    }}
    id="mobile-number-input"
  />
</FormControl><br />

您需要使用另一个类的名称(而不是JSS对象)覆盖
inkbar

一种方法是在组件外部声明JSS对象,并使用
with style
高阶组件为组件提供一个
道具,该道具将JSS中定义的类名映射到它们的实际名称:

从“材质ui/样式”导入{with样式};
常量样式={
inkbarOverride:{
“&:在”之后:{
背景颜色:“白色”,
}
}
};
常量测试=({classes})=>
手机号码
导出默认样式(样式)(测试);
有关更多信息,请参阅

Warning: Material-UI: the key `inkbar` provided to the classes property is not valid for Input.
You need to provide a non empty string instead of: [object Object].