# 水平排列的表单 - order: 2 示例展示了如何通过使用 `Form.ValueMixin` 来获取和更新表单提交的数值。 **注意:** 1)需要为每个输入控件声明 `name` 属性;2)ES6 语法 [不支持 `mixins`](https://facebook.github.io/react/docs/reusable-components.html#no-mixins); --- ````jsx import { Form, Input, Button, Checkbox, Radio, Row, Col } from 'antd'; const FormItem = Form.Item; const RadioGroup = Radio.Group; const Demo = React.createClass({ mixins: [Form.ValueMixin], getInitialState() { return { formData: { userName: '大眼萌 minion', password: undefined, gender: 'male', remark: undefined, agreement: undefined, } }; }, handleSubmit(e) { e.preventDefault(); console.log('收到表单值:', this.state.formData); }, render() { const formData = this.state.formData; return (
); } }); ReactDOM.render(