Material UI MuiClockPicker 样式覆盖
Material UI MuiClockPicker style overrides
我很好奇如何覆盖 MuiClockPicker
的样式?
我发现 createTheme
处的这个覆盖实际上对我有用,但我从打字稿中收到一个错误:
TS2322: Type '{ MuiOutlinedInput: { styleOverrides: { root: { color: string; border: string; }; }; }; MuiInputLabel: { styleOverrides: { root: { color: string; backgroundColor: string; paddingRight: string; paddingLeft: string; }; }; }; ... 4 more ...; MuiClockPicker: { ...; }; }' is not assignable to type 'Components'. Object literal may only specify known properties, and 'MuiClockPicker' does not exist in type 'Components'.
这是一个代码:
import { createTheme } from '@mui/material/styles'
export const theme = createTheme({
...
components: {
MuiClockPicker: {
styleOverrides: {
arrowSwitcher: {
display: 'none',
},
},
},
},
})
这是我找到的唯一方法,但绝对不是最好的解决方案:
button[aria-label='open previous view'] {
display: none;
}
button[aria-label='open next view'] {
display: none;
}
我很好奇如何覆盖 MuiClockPicker
的样式?
我发现 createTheme
处的这个覆盖实际上对我有用,但我从打字稿中收到一个错误:
TS2322: Type '{ MuiOutlinedInput: { styleOverrides: { root: { color: string; border: string; }; }; }; MuiInputLabel: { styleOverrides: { root: { color: string; backgroundColor: string; paddingRight: string; paddingLeft: string; }; }; }; ... 4 more ...; MuiClockPicker: { ...; }; }' is not assignable to type 'Components'. Object literal may only specify known properties, and 'MuiClockPicker' does not exist in type 'Components'.
这是一个代码:
import { createTheme } from '@mui/material/styles'
export const theme = createTheme({
...
components: {
MuiClockPicker: {
styleOverrides: {
arrowSwitcher: {
display: 'none',
},
},
},
},
})
这是我找到的唯一方法,但绝对不是最好的解决方案:
button[aria-label='open previous view'] {
display: none;
}
button[aria-label='open next view'] {
display: none;
}