reactjs - React JS - 如何在对话框的 PaperProps 中添加样式(material-ui)
问题描述
我正在使用 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 中是否可以覆盖样式。
就像是PaperProps={{ classes: {root: classes.dialogPaper}, style:{} }}
如果我错了,请告诉我。我也想覆盖样式。
解决方案
我得到了答案
<Dialog
{...otherProps}
PaperProps={{
style: {
backgroundColor: 'transparent',
boxShadow: 'none',
},
}}
>
{/* ... your content ... */}
</Dialog>
这就是我们如何在对话框组件的 PaperProps 中放置样式。
推荐阅读
- dart - Flutter:Textfield初始值产生额外的新行
- c# - c#中表达式树的单元测试
- php - PHP Wordpress Woocommerce 通过 ID 获取产品名称
- php - SQL 更新行 while row[val]<$_POST['$val];
- php - 从联系我们表格发送电子邮件的问题
- jsf - JSF 无法处理 onload 方法
- abap - 选择单个与最多选择 1 行
- google-api - 谷歌人getBatchGet中的resourceNames逗号分隔吗?
- mysql - 如何将逗号分隔的列转换为mysql中的多行?
- testing - TFS 测试图表 - 如何分配要在仪表板中显示的测试结果图表,直到 sprint 结束日期?