我想到显示器的背景图像对全尺寸的父母组件,这种图像是被分配到常数"图像",父母对话,从材料的用户界面。 下面是代码我现在不能工作。 我应该怎样实现的?
const image =
'../../../../../../shared/src/lib/assets/images/logo/SVG/nevomo_logo_orange.svg';
return (
<div>
<StyledLogo onClick={handleClickOpen} />
<StyledDialog
onClose={handleClose}
aria-labelledby="alert-picture-zoom-in"
open={open}
sx={{ backgroundImage: { image } }}
>
<StyledImageContent>sss</StyledImageContent>
<StyledCloseIcon onClick={handleClose} />
</StyledDialog>
export const StyledDialog = styled(Dialog)`
& .MuiDialog-paper {
overflow: unset;
height: 50rem;
width: 46.4rem;
border: 0.4rem solid #ffffff;
border-radius: unset;
background-image: ${(props) => props.image};
}
`;
非常感谢!