根据material-ui中的文档,它在组件之间提供了空间。但是我可以在这里得到高度和宽度的方式:
`width: theme.spacing(20),
height: theme.spacing(15)`
theme.spacing()如何在此处设置宽度和高度。
const theme = createMuiTheme({
spacing: 8,
});
定义主题后,您将获得一个间距值。默认情况下,此值为8px
。因此,当您调用theme.spacing(20)
时,如果spacing value
为8
,则仅返回20 * 8
=> 160px
。