diff --git a/components/cascader/demo/size.md b/components/cascader/demo/size.md
new file mode 100644
index 0000000000..8e8c2123a3
--- /dev/null
+++ b/components/cascader/demo/size.md
@@ -0,0 +1,47 @@
+# 大小
+
+- order: 7
+
+不同大小的级联选择器。
+
+---
+
+````jsx
+import { Cascader } from 'antd';
+
+const options = [{
+ value: 'zhejiang',
+ label: '浙江',
+ children: [{
+ value: 'hangzhou',
+ label: '杭州',
+ children: [{
+ value: 'xihu',
+ label: '西湖',
+ }],
+ }],
+}, {
+ value: 'jiangsu',
+ label: '江苏',
+ children: [{
+ value: 'nanjing',
+ label: '南京',
+ children: [{
+ value: 'zhonghuamen',
+ label: '中华门',
+ }],
+ }],
+}];
+
+function onChange(value) {
+ console.log(value);
+}
+
+ReactDOM.render(
+
+
+
+
+
+, mountNode);
+````
diff --git a/components/cascader/index.jsx b/components/cascader/index.jsx
index e79c1ed6bd..32a732eb8d 100644
--- a/components/cascader/index.jsx
+++ b/components/cascader/index.jsx
@@ -104,7 +104,6 @@ AntCascader.defaultProps = {
return label.join(' / ');
},
disabled: false,
- size: 'default',
onPopupVisibleChange() {},
};
diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx
index 0f5c73d464..5ff24a0929 100644
--- a/components/form/FormItem.jsx
+++ b/components/form/FormItem.jsx
@@ -118,12 +118,29 @@ class FormItem extends React.Component {
renderChildren() {
const context = this.context;
const props = this.props;
- let children = props.children;
+ let children = null;
if (context.form && props.id && props.fieldOption) {
+ const child = React.Children.only(props.children);
+ const size = {};
+ if (typeof child.type === 'function' && !child.props.size) {
+ size.size = 'large';
+ }
children = React.cloneElement(
- React.Children.only(children),
- { ...context.form.getFieldProps(props.id, props.fieldOption), id: props.id }
+ child,
+ {
+ ...context.form.getFieldProps(props.id, props.fieldOption),
+ ...size,
+ id: props.id
+ }
);
+ } else {
+ children = React.Children.map(props.children, (child) => {
+ if (typeof child.type === 'function' && !child.props.size) {
+ return React.cloneElement(child, { size: 'large' });
+ }
+
+ return child;
+ });
}
return [
this.renderLabel(),
diff --git a/components/form/demo/mix.md b/components/form/demo/mix.md
index a30ec60105..421e2205d5 100644
--- a/components/form/demo/mix.md
+++ b/components/form/demo/mix.md
@@ -7,7 +7,7 @@
---
````jsx
-import { Form, Select, InputNumber, DatePicker, Switch, Radio,
+import { Form, Select, InputNumber, DatePicker, TimePicker, Switch, Radio,
Slider, Button, message, Row, Col, Upload, Icon } from 'antd';
const FormItem = Form.Item;
const Option = Select.Option;
@@ -56,7 +56,7 @@ const Demo = React.createClass({
labelCol={{span: 8}}
wrapperCol={{span: 10}}
required>
-
+
台机器
@@ -92,7 +92,7 @@ const Demo = React.createClass({
labelCol={{span: 8}}
wrapperCol={{span: 16}}
required>
-