问题
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>
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.
Something like PaperProps={{ classes: {root: classes.dialogPaper}, style:{} }}
Please tell me if I am wrong. I want to override style also.
回答1:
I got my answer
<Dialog
{...otherProps}
PaperProps={{
style: {
backgroundColor: 'transparent',
boxShadow: 'none',
},
}}
>
{/* ... your content ... */}
</Dialog>
This is how we can put style in PaperProps of dialog component.
回答2:
<Dialog
PaperProps={{
style: {
backgroundColor: 'Blue',
color:'black'
},
}}
>
</Dialog>
来源:https://stackoverflow.com/questions/51722676/react-js-how-to-add-style-in-paperprops-of-dialog-material-ui