React JS-如何在对话框的PaperProps中添加样式(material-ui) [英] React JS - How to add style in PaperProps of Dialog (material-ui)
本文介绍了React JS-如何在对话框的PaperProps中添加样式(material-ui)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Material-ui ReactJs中的Dialog组件.
I am using Dialog components from material-ui ReactJs.
<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中是否可以覆盖样式.
In the above code I already override the root classes of PaperProps. Now I also want to override the style in the PaperProps. Is that possible in the PaperProps to override the styles.
类似于PaperProps={{ classes: {root: classes.dialogPaper}, style:{} }}
如果我错了,请告诉我.我也想覆盖样式.
Please tell me if I am wrong. I want to override style also.
推荐答案
我得到了答案
<Dialog
{...otherProps}
PaperProps={{
style: {
backgroundColor: 'transparent',
boxShadow: 'none',
},
}}
>
{/* ... your content ... */}
</Dialog>
这是我们如何在对话框组件的PaperProps中放置样式的方法.
This is how we can put style in PaperProps of dialog component.
这篇关于React JS-如何在对话框的PaperProps中添加样式(material-ui)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文