📅  最后修改于: 2022-03-11 15:02:39.309000             🧑  作者: Mango
import React from "react";
import { Form, Select, Button } from "antd";
import "./styles.css";
import "antd/dist/antd.css";
const { Option } = Select;
const AppWithForm = props => {
const { getFieldDecorator } = props.form;
const handleSubmit = () => {
props.form.validateFields((err, values) => {
if (!err) {
console.log("Received values of form: ", values);
} else console.log("form is NOT valid");
});
};
const onChange = value => {
console.log(`selected ${value}`);
};
return (
{getFieldDecorator("dropdown", {
rules: [{ required: true, message: "Please select a person!" }]
})(
)}
);
};
const App = Form.create({})(AppWithForm);
export default App;