style={{top:'20'}}-这似乎不起作用。我该怎么办?所有其他antd功能都在工作。
const LoginModal = ({ showModal, setShowModal }) => {
//const [form] = Form.useForm();
const onFinish = (values) => {
console.log('Received values of form: ', values);
};
return (
<Modal
title="Sign In"
**style={{ top: '20' }}**
visible={showModal}
onCancel={() => setShowModal(!showModal)}
width={500}
>
<h1>Welcome Back !</h1>
<Form
name="normal_login"
className="login-form"
initialValues={{
remember: true,
}}
onFinish={onFinish}
>
使用此样式
import { makeStyles } from '@material-ui/core'
const useStyles = makeStyles((theme) => ({
modalStyle:{
marginTop:theme.Spacing(5);
}
}));
const classes = useStyles();
return(
className={classes.modalStyle}
)