【发布时间】:2019-10-31 09:17:09
【问题描述】:
我正在尝试在我的表单组件中自定义 antd ant-row 类,以便我可以更改输入字段之间的高度。我已经为我的表单定义了一个不同的类名,并尝试在 css 文件中对其进行修改,但是它没有被修改或应用。有人可以帮忙吗?
Form.js
{this.state.active2 && (
<Form
style={{
position: 'relative',
zindex: '2',
left: '35%',
overflow: 'initial',
width: '300px',
}}
onSubmit={this.handleSubmit}
className="login-form"
layout={formLayout}>
<Form.Item>
<Form.Item label="Full name" {...formLayout}>
{form.getFieldDecorator('username', {
rules: [{ required: true, message: 'Please input your username!' }],
})(
<Input
prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
placeholder="input placeholder"
/>,
)}
</Form.Item>
</Form.Item>
styles.scss
.login-form.ant-row {
position: relative !important;
height: 70px !important;
margin-left: 0 !important;
zoom: 1 !important;
display: block !important;
box-sizing: border-box !important;
}
【问题讨论】:
-
您是否要调整每个
Form.Item之间的边距? -
是的,现在它们彼此相距很远,我想让它们彼此靠近
标签: javascript reactjs antd