我想对 TextFiled 组件进行不同的样式设置,一旦禁用= {true},就会概述变体。
在 Material ui v.4 中捕获它的方式在 Material ui v.5 中不起作用。我也无法通过谷歌搜索如何自定义禁用版本的解决方案。
下面您可以看到它是如何在材质 ui4 中设置样式的,并且它有效,而不是无效。
export const MainTheme: Theme = createTheme({
components: {
MuiInputLabel: {
styleOverrides: {
root: {
fontSize: '13px',
'&$focused': {
borderColor: '#000',
},
'&$disabled': {
color: '#724a4a',
},
},
},
},
MuiInputBase: {
styleOverrides: {
root: {
'&$disabled': {
'& fieldset.MuiOutlinedInput-notchedOutline': {
borderColor: 'transparent',
background: 'rgb(0 0 0 / 4%)',
},
},
},
input: {
height: 'unset',
color: '#000000',
},
},
},
},
)}