我正在使用material-ui ReactJs 中的Dialog 组件。
<Dialog fullScreen open={this.state.open}
PaperProps={{ classes: {root: classes.dialogPaper} }}
onClose={this.handleClose.bind(this)} transition={this.props.transition}>
{this.props.children}
</Dialog>
在上面的代码中,我已经重写了 PaperProps 的根类。现在我还想覆盖 PaperProps 中的样式。是否可以在 PaperProps 中覆盖样式。
就像是PaperProps={{ classes: {root: classes.dialogPaper}, style:{} }}
如果我错了,请告诉我。我也想覆盖风格。
我得到了我的答案
<Dialog
{...otherProps}
PaperProps={{
style: {
backgroundColor: 'transparent',
boxShadow: 'none',
},
}}
>
{/* ... your content ... */}
</Dialog>
这就是我们如何将样式放入对话框组件的 PaperProps 中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)