我想将菜单移到页面的左侧,以便中间没有空格。但无论我做什么,它都不会向左侧移动。请提出一些解决方案。
以下是我的相关代码:
<Menu
anchorReference="anchorPosition"
anchorPosition={{ top: 90, left: 0 }}
anchorOrigin={{
vertical: "bottom",
horizontal: "left",
}}
transformOrigin={{ vertical: "top", horizontal: "left" }}
keepMounted
open={open}
onClose={handleClose}
classes={{ paper: classes.menuPaper }}
>
来自类对象的弹出框样式:
menuPaper: {
backgroundColor: theme.palette.secondary.light,
width: "100%",
maxWidth: "unset",
},
答案 0 :(得分:0)
我终于明白了。 popever 中有这个 props margin treshold。我把它的值设为 0 并且它起作用了。 @Mateen 部分正确,它不是边距,但左侧位置偏移了 16。它的保证金阈值的默认值。它必须被覆盖为 0。