Lar*_*ara 1 javascript css reactjs material-ui
我试图通过将其锚定到 来使用 Material UI 抽屉,它可以top正常工作,但唯一的问题是我无法更改抽屉的宽度,它占用了页面的整个宽度。我尝试更新 css 中的宽度,例如
list: {
width: 250. //tried to update it to 100, but its not taking
},
Run Code Online (Sandbox Code Playgroud)
代码沙盒 如何更新宽度?
Fre*_*Eid 10
对于 MUI 版本 5,您必须PaperProps像这样使用该 prop:
<Drawer
PaperProps={{
sx: { width: "90%" },
}}
>
/* ...child elements */
</Drawer>
Run Code Online (Sandbox Code Playgroud)
这是Drawer paper你必须改变的。
const useStyles = makeStyles({
paper: {
width: 250
}
});
<Drawer
anchor={anchor}
open={state[anchor]}
onClose={toggleDrawer(anchor, false)}
classes={{ paper: classes.paper }}
>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1380 次 |
| 最近记录: |