如何更改迷你变体抽屉的背景颜色?

huangapple go评论112阅读模式
英文:

How to change background colour of the mini variant drawer?

问题

我已经尝试过使用他们的方法之一来更改颜色,例如

V1
<Drawer style={{backgroundColour: black}} variant="permanent" open={open} >

V2
<Drawer variant="permanent" open={open}
      backgroundColor="black">

但抽屉的颜色就是不会改变,什么都不会发生,我查看了文档,但文档并没有明确告诉我该怎么做。我对React还相当陌生。

迷你变体抽屉

迷你变体抽屉

试图将此抽屉更改为黑色。

英文:

I have tried changing the colour using one of their methods such as

V1
<Drawer style={{backgroundColour: black}} variant="permanent" open={open} >

V2
<Drawer variant="permanent" open={open}
      backgroundColor="black">

But it just won't change in the drawer, nothing happens, I've looked at documentation and it doesn't clearly tell me what to do for it. I'm quite new to react.

Mini Variant Drawer

Mini Variant Drawer

Was trying to change this drawer to black

答案1

得分: 0

哈哈,试试使用PaperProps,希望能解决这个问题:

<Drawer variant="permanent" open={open}
    PaperProps={{
        style: {
            backgroundColor: "black",
        },
    }}
>
英文:

Aha, just try to use PaperProps, hope is would solve the issue:

    &lt;Drawer variant=&quot;permanent&quot; open={open}
        PaperProps={{
            style: {
            backgroundColor: &quot;black&quot;,
            },
        }}
     &gt;

huangapple
  • 本文由 发表于 2023年3月3日 22:21:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75628254.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定