Javascript 更改标签材质ui的字体大小
我就是搞不懂这个,伙计们。我想更改文本字段中标签的字体大小。到目前为止,我只能更改输入的字体大小,但不能更改标签 文本字段:Javascript 更改标签材质ui的字体大小,javascript,reactjs,material-ui,Javascript,Reactjs,Material Ui,我就是搞不懂这个,伙计们。我想更改文本字段中标签的字体大小。到目前为止,我只能更改输入的字体大小,但不能更改标签 文本字段: <TextField className={classes.TextField} id="input-with-icon-textfield" label="Zoeken" InputProps={{ startAdornment: ( <InputAdornment position="start">
<TextField
className={classes.TextField}
id="input-with-icon-textfield"
label="Zoeken"
InputProps={{
startAdornment: (
<InputAdornment position="start">
<Search />
</InputAdornment>
),
}}
onChange={(e) => {this.setTextFilter(e.target.value);}}
/>
{this.setTextFilter(e.target.value);}
/>
添加了一张图片,以便您可以通过标签了解我的意思 我最后向我的主mui主题添加了一些代码
const theme = createMuiTheme({
palette: {
primary: {
main: '#39870c',
ligth: '#6cb842',
dark: '#005900'
},
secondary: {
light: '#01689b',
main: '#0044ff',
contrastText: '#ffcc00',
},
},
overrides: {
MuiInputLabel: {
root: {
color:'black',
fontSize: 13,
},
},
}
});
有了覆盖,我基本上可以改变任何事情。我希望这对以后的人有所帮助,因为这真的很烦人 这里的另一个选项:insted overrides可以用作标签道具内的排版组件。参见示例
<TextField
label={
<Typography variant="headline" component="h3"> Zoeken </Typography>
} ..../>
希望这能对其他人有所帮助。也在这里发布您的渲染html,谢谢你的朋友。。它对我很有效。快乐编码:)