我使用的对话,从材料的用户界面与反应js和要宽度的增加。 我知道有一个称为道具 maxWidth
和我使用它。 它不仅增加了宽度高达900px(当 maxWidth="lg"
). 我知道有一个 fullScreen
托在它的对话需要整个画面。 什么我想要的是不要采取整个屏幕,但我希望有更多的宽度比900px. 有人可以帮我吗?
1
想通了...
你不得不进口 makeStyles
从 material-ui/core
并复盖一些材料造型。
这是对话共同组成的代码。
import React from 'react';
//Material UI Components
import {
Dialog,
DialogContent
} from '@material-ui/core';
//Material UI Styling
import {
makeStyles
} from '@material-ui/core/styles';
const useStyles = makeStyles({
root: {
".MuiDialogContent-root": {
padding: "0px 24px 8px 24px !important"
},
"& .MuiDialog-paperWidthLg": {
maxWidth: "none !important"
},
"& .MuiDialog-paper": {
margin: 0
},
"& .MuiDialogTitle-root": {
padding: "4px !important"
}
},
content: {
"&:first-child": {
paddingTop: "12px"
}
}
});
export default function PopUp(props) {
const {
children,
openPopup,
setOpenPopup,
} = props;
const classes = useStyles();
const handleClose = () => {
setOpenPopup(false);
};
return (
<
Dialog className = {
classes.root
}
onClose = {
handleClose
}
open = {
openPopup
}
maxWidth = "lg" >
<
DialogContent className = {
classes.content
} > {
children
} <
/DialogContent>
<
/Dialog>
)
}