Fix lots of Form style

This commit is contained in:
afc163 2016-05-19 15:21:48 +08:00
parent 568e79d878
commit b15ae59101
5 changed files with 24 additions and 34 deletions

View File

@ -19,7 +19,7 @@ ReactDOM.render(
label="搜索名称:"
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}>
<Input placeholder="请输入搜索名称" />
<Input placeholder="请输入搜索名称" size="default" />
</FormItem>
<FormItem
label="较长搜索名称:"
@ -31,7 +31,7 @@ ReactDOM.render(
label="搜索名称:"
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}>
<Input placeholder="请输入搜索名称" />
<Input placeholder="请输入搜索名称" size="default" />
</FormItem>
</Col>
<Col sm={8}>
@ -39,7 +39,7 @@ ReactDOM.render(
label="搜索名称:"
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}>
<Input placeholder="请输入搜索名称" />
<Input placeholder="请输入搜索名称" size="default" />
</FormItem>
<FormItem
label="较长搜索名称:"
@ -51,7 +51,7 @@ ReactDOM.render(
label="搜索名称:"
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}>
<Input placeholder="请输入搜索名称" />
<Input placeholder="请输入搜索名称" size="default" />
</FormItem>
</Col>
<Col sm={8}>
@ -59,7 +59,7 @@ ReactDOM.render(
label="搜索名称:"
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}>
<Input placeholder="请输入搜索名称" />
<Input placeholder="请输入搜索名称" size="default" />
</FormItem>
<FormItem
label="较长搜索名称:"
@ -71,7 +71,7 @@ ReactDOM.render(
label="搜索名称:"
labelCol={{ span: 10 }}
wrapperCol={{ span: 14 }}>
<Input placeholder="请输入搜索名称" />
<Input placeholder="请输入搜索名称" size="default" />
</FormItem>
</Col>
</Row>

View File

@ -52,7 +52,7 @@ let Demo = React.createClass({
const formItems = getFieldValue('keys').map((k) => {
return (
<Form.Item {...formItemLayout} label={`好朋友${k}`} key={k}>
<Input {...getFieldProps(`name${k}`)} style={{ width: '80%', marginRight: 10 }} />
<Input {...getFieldProps(`name${k}`)} style={{ width: '80%', marginRight: 8 }} />
<Button onClick={() => this.remove(k)}>删除</Button>
</Form.Item>
);
@ -61,8 +61,7 @@ let Demo = React.createClass({
<Form horizontal form={this.props.form}>
{formItems}
<Form.Item wrapperCol={{ span: 18, offset: 6 }}>
<Button onClick={this.add}>新增好朋友</Button>
&nbsp;
<Button onClick={this.add} style={{ marginRight: 8 }}>新增好朋友</Button>
<Button type="primary" onClick={this.submit}>提交</Button>
</Form.Item>
</Form>

View File

@ -106,16 +106,21 @@ let Demo = React.createClass({
labelCol={{ span: 8 }}
required>
<Col span="6">
<DatePicker {...getFieldProps('startDate')} />
<FormItem>
<DatePicker {...getFieldProps('startDate')} />
</FormItem>
</Col>
<Col span="1">
<p className="ant-form-split">-</p>
</Col>
<Col span="6">
<DatePicker {...getFieldProps('endDate')} />
<FormItem>
<DatePicker {...getFieldProps('endDate')} />
</FormItem>
</Col>
</FormItem>
<FormItem
label="TimePicker 时间选择器:"
labelCol={{ span: 8 }}

View File

@ -73,7 +73,7 @@ ReactDOM.render(
</FormItem>
<FormItem
label="Datepicker"
label="行内校验"
labelCol={{ span: 5 }}
help>
<Col span="6">
@ -90,25 +90,6 @@ ReactDOM.render(
</FormItem>
</Col>
</FormItem>
<FormItem
label="Datepicker"
labelCol={{ span: 5 }}
validateStatus="error"
help>
<Col span="6">
<DatePicker />
</Col>
<Col span="1">
<p className="ant-form-split">-</p>
</Col>
<Col span="6">
<DatePicker />
</Col>
<Col span="19" offset="5">
<p className="ant-form-explain">请选择正确日期</p>
</Col>
</FormItem>
</Form>
, mountNode);
````

View File

@ -69,12 +69,18 @@ input[type="checkbox"] {
margin-bottom: @form-item-margin-bottom;
color: #666;
// nested FormItem
& & {
margin-bottom: -@form-item-margin-bottom;
}
&-control {
line-height: 32px;
position: relative;
.clearfix;
}
&.@{form-prefix-cls}-item-with-help {
&-with-help {
margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base - 3;
}
@ -237,8 +243,7 @@ form {
}
.ant-radio-inline,
.ant-checkbox-inline,
.ant-input {
.ant-checkbox-inline {
vertical-align: baseline;
}
}