我有两个媒体询问。
@media (min-width: 1300px) {
.container {
width: auto;
max-width: 1360px;
}
}
@media (min-width: 1565px) {
.container {
width: auto;
max-width: 1576px;
}
}
Run Code Online (Sandbox Code Playgroud)
无论宽度是多少。容器始终作为第一个媒体查询。我的意思是当主体宽度为 1570px 时,容器宽度仍然为 1360px!
我正在尝试创建一个Dialog基于 MUI 对话框的可重用组件。
这是我的代码:
import React from 'react';
import {
Dialog as MuiDialog,
DialogProps,
Button,
DialogContent,
DialogActions,
DialogTitle,
} from '@material-ui/core';
const Dialog = ({ title, open, onClose, children, ...props }: DialogProps) => {
return (
<MuiDialog
onClose={onClose}
aria-labelledby='simple-dialog-title'
open={open}
>
<DialogTitle id='simple-dialog-title'>{title}</DialogTitle>
<DialogContent>{children}</DialogContent>
<DialogActions>
<Button onClick={onClose} color='primary'>
Close
</Button>
</DialogActions>
</MuiDialog>
);
};
Run Code Online (Sandbox Code Playgroud)
它一直显示错误<Button onClick={onClose} color='primary'>
错误:
No overload matches this call.
Overload 1 of 3, '(props: { href: string; } & { children?: ReactNode; color?: …Run Code Online (Sandbox Code Playgroud)