根据material-ui中的文档,它提供了组件之间的空间。但是我可以在这里得到它的高度和宽度:
width: theme.spacing(20),
height: theme.spacing(15)theme.spacing()是如何在这里设置宽度和高度的?
发布于 2020-05-19 16:31:01
const theme = createMuiTheme({
spacing: 8,
});当你的主题被定义时,你就有了一个间隔值。默认情况下,此值为8px。因此,当您调用theme.spacing(20)时,如果spacing value为8,则只返回20 * 8 => 160px。
https://stackoverflow.com/questions/61886324
复制相似问题