【发布时间】:2022-01-24 17:12:13
【问题描述】:
我正在关注他们来自 Here 的文档来修改默认的 Paper 组件属性。
这是我的代码。
import { styled } from '@mui/material/styles';
import { Modal, Button, TextField, Grid, Paper } from '@mui/material';
const Item:any = styled(Paper)(({theme}) => ({
// ...theme.typography.body2,
root: {
boxShadow: '1px 1px 1px 1px rgba(255,255,255,0.2)',
},
padding: theme.spacing(1),
textAlign: 'center',
color: theme.palette.text.secondary,
boxShadow: '1px 1px 1px 1px rgba(255,255,255,0.2)',
'& .MuiPaper-root': {
boxShadow: '1px 1px 1px 1px rgba(255,255,255,0.2)',
}
}));
const MyComponent = (props: any) => {
return (
<Grid container>
<Grid item xs={8}>
<Item elevation={1} square variant="outlined">xs=8</Item>
</Grid>
</Grid>
)
}
我在这里做错了什么?
【问题讨论】:
标签: javascript reactjs material-ui material-design