更改应用栏背景颜色失败
Failed to change the appbar backgroud color
我用https://codesandbox.io/s/github/SabuShakya/React-Sidebar-Using-Material-UI/一个作为参考,
我想更新appbar的背景为#ffb74d,
我检查了很多答案,答案在我试过的其他项目中对我有用,但同样的方法在这个项目中无济于事,我不知道这里出了什么问题
下面的代码是我在MiniDrawer.js中添加的,没有达到预期效果
const theme = createMuiTheme({
palette: {
primary: {
// Purple and green play nicely together.
main: '#0fb7ae',
},
secondary: {
// This is green.A700 as hex.
main: '#11cb5f',
},
},
});
....
<ThemeProvider theme={theme}>
<AppBar
position="fixed"
color={theme.palette.primary.main}
.......
有人帮我吗?
你可以试试这个 Appbar 背景颜色
我用https://codesandbox.io/s/github/SabuShakya/React-Sidebar-Using-Material-UI/一个作为参考, 我想更新appbar的背景为#ffb74d,
我检查了很多答案,答案在我试过的其他项目中对我有用,但同样的方法在这个项目中无济于事,我不知道这里出了什么问题
下面的代码是我在MiniDrawer.js中添加的,没有达到预期效果
const theme = createMuiTheme({
palette: {
primary: {
// Purple and green play nicely together.
main: '#0fb7ae',
},
secondary: {
// This is green.A700 as hex.
main: '#11cb5f',
},
},
});
....
<ThemeProvider theme={theme}>
<AppBar
position="fixed"
color={theme.palette.primary.main}
.......
有人帮我吗?
你可以试试这个 Appbar 背景颜色