# 水平排列的表单 - 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, message} 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(); message.success('收到表单值~~~ :' + JSON.stringify(this.state.formData, function(k, v) { if (typeof v === 'undefined') { return ''; } return v; })); }, render() { const formData = this.state.formData; return (

大眼萌 minion

男的 女的
); } }); ReactDOM.render(, mountNode); ````