diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx
index 65df9dd4f5..9675ec1b44 100644
--- a/components/form/FormItem.jsx
+++ b/components/form/FormItem.jsx
@@ -89,7 +89,7 @@ class FormItem extends React.Component {
}
isRequired() {
- const options = this.props.options;
+ const options = this.props.fieldOption;
if (options === undefined) return false;
const allRules = (options.validate || []).concat({
@@ -119,10 +119,10 @@ class FormItem extends React.Component {
const context = this.context;
const props = this.props;
let children = props.children;
- if (context.form && props.id && props.options) {
+ if (context.form && props.id && props.fieldOption) {
children = React.cloneElement(
React.Children.only(children),
- { ...context.form.getFieldProps(props.id, props.options), id: props.id }
+ { ...context.form.getFieldProps(props.id, props.fieldOption), id: props.id }
);
}
return [
@@ -168,7 +168,7 @@ FormItem.propTypes = {
wrapperCol: React.PropTypes.object,
className: React.PropTypes.string,
id: React.PropTypes.string,
- options: React.PropTypes.object,
+ fieldOption: React.PropTypes.object,
children: React.PropTypes.node,
};
diff --git a/components/form/demo/validate-basic.md b/components/form/demo/validate-basic.md
index 03765927bd..75d21f6637 100644
--- a/components/form/demo/validate-basic.md
+++ b/components/form/demo/validate-basic.md
@@ -87,7 +87,7 @@ class BasicDemo extends React.Component {
wrapperCol={{span: 12}}
hasFeedback
id="name"
- options={{
+ fieldOption={{
rules: [
{required: true, min: 5, message: '用户名至少为 5 个字符'},
{validator: this.userExists},
@@ -103,7 +103,7 @@ class BasicDemo extends React.Component {
wrapperCol={{span: 12}}
hasFeedback
id="email"
- options={{
+ fieldOption={{
validate: [{
rules: [
{required: true},
@@ -125,7 +125,7 @@ class BasicDemo extends React.Component {
wrapperCol={{span: 12}}
hasFeedback
id="passwd"
- options={{
+ fieldOption={{
rules: [
{ required: true, whitespace: true, message: '请填写密码' },
{ validator: this.checkPass.bind(this) },
@@ -141,7 +141,7 @@ class BasicDemo extends React.Component {
wrapperCol={{span: 12}}
hasFeedback
id="rePasswd"
- options={{
+ fieldOption={{
rules: [{
required: true,
whitespace: true,
@@ -159,7 +159,7 @@ class BasicDemo extends React.Component {
labelCol={{span: 7}}
wrapperCol={{span: 12}}
id="textarea"
- options={{
+ fieldOption={{
rules: [
{required: true, message: '真的不打算写点什么吗?'},
],
diff --git a/components/form/demo/validate-customized.md b/components/form/demo/validate-customized.md
index 9d89c5d40e..edc7642074 100644
--- a/components/form/demo/validate-customized.md
+++ b/components/form/demo/validate-customized.md
@@ -130,7 +130,7 @@ let Demo = React.createClass({
labelCol={{span: 6}}
wrapperCol={{span: 18}}
id="pass"
- options={{
+ fieldOption={{
rules: [
{required: true, whitespace: true, message: '请填写密码'},
{validator: this.checkPass}
@@ -153,7 +153,7 @@ let Demo = React.createClass({
labelCol={{span: 6}}
wrapperCol={{span: 18}}
id="rePass"
- options={{
+ fieldOption={{
rules: [{
required: true,
whitespace: true,
diff --git a/components/form/demo/validate-other.md b/components/form/demo/validate-other.md
index f00769ec69..3f98df7f4f 100644
--- a/components/form/demo/validate-other.md
+++ b/components/form/demo/validate-other.md
@@ -65,7 +65,7 @@ let Demo = React.createClass({
labelCol={{span: 7}}
wrapperCol={{span: 12}}
id="select"
- options={{
+ fieldOption={{
rules: [
{ required: true, message: '请选择您的国籍' }
],
@@ -84,7 +84,7 @@ let Demo = React.createClass({
labelCol={{span: 7}}
wrapperCol={{span: 12}}
id="multiSelect"
- options={{
+ fieldOption={{
rules: [
{ required: true, message: '请选择您喜欢的颜色', type: 'array' },
]
@@ -103,7 +103,7 @@ let Demo = React.createClass({
labelCol={{span: 7}}
wrapperCol={{span: 12}}
id="radio"
- options={{
+ fieldOption={{
rules: [
{ required: true, message: '请选择您的性别' }
]
@@ -119,7 +119,7 @@ let Demo = React.createClass({
labelCol={{span: 7}}
wrapperCol={{span: 12}}
id="birthday"
- options={{
+ fieldOption={{
rules: [
{
required: true,
@@ -138,7 +138,7 @@ let Demo = React.createClass({
labelCol={{span: 7}}
wrapperCol={{span: 12}}
id="primeNumber"
- options={{
+ fieldOption={{
rules: [{ validator: this.checkPrime }],
}}>