mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 23:46:28 +08:00
Add cascader to form demo
This commit is contained in:
parent
7e7b4b2cf7
commit
9b13c34889
@ -9,7 +9,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
````jsx
|
````jsx
|
||||||
import { Select, Radio, Button, DatePicker, InputNumber, Form } from 'antd';
|
import { Select, Radio, Button, DatePicker, InputNumber, Form, Cascader } from 'antd';
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
const RadioGroup = Radio.Group;
|
const RadioGroup = Radio.Group;
|
||||||
const createForm = Form.create;
|
const createForm = Form.create;
|
||||||
@ -50,6 +50,14 @@ let Demo = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const address = [{
|
||||||
|
value: 'zhejiang',
|
||||||
|
label: '浙江',
|
||||||
|
children: [{
|
||||||
|
value: 'hangzhou',
|
||||||
|
label: '杭州',
|
||||||
|
}],
|
||||||
|
}];
|
||||||
return (
|
return (
|
||||||
<Form horizontal form={this.props.form}>
|
<Form horizontal form={this.props.form}>
|
||||||
<FormItem
|
<FormItem
|
||||||
@ -133,7 +141,18 @@ let Demo = React.createClass({
|
|||||||
options={{
|
options={{
|
||||||
rules: [{ validator: this.checkPrime }],
|
rules: [{ validator: this.checkPrime }],
|
||||||
}}>
|
}}>
|
||||||
<InputNumber min={8} max={12} />
|
<InputNumber min={8} max={12} size="large" />
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label="选择地址:"
|
||||||
|
labelCol={{span: 7}}
|
||||||
|
wrapperCol={{span: 12}}
|
||||||
|
id="address"
|
||||||
|
options={{
|
||||||
|
rules: [{ required: true, type: 'array' }],
|
||||||
|
}}>
|
||||||
|
<Cascader options={address} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
|
||||||
&-clear {
|
&-clear {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user