【发布时间】:2021-04-30 07:30:12
【问题描述】:
我有一个表单,我想内联一个选择填充前 60% 的空间,提交按钮填充接下来的 40%。 如果没有选择和按钮大小不正确,我无法弄清楚如何做到这一点。 选择大小本身以匹配其输入,从几乎没有大小开始。 按钮的大小小于其文本。 在这种情况下你应该怎么做?
<Form layout="inline">
<Form.Item style={{width:'60%'}}>
{getFieldDecorator('studentId', {
rules: [{ required: true, message: 'You must select a student' }],
})(
<Select style={{width:'100%'}}>
{this.props.linkedStudents.map(x => <Select.Option value={x.id}>{x.fullName}</Select.Option>)}
</Select>
)}
</Form.Item>
<Form.Item style={{width:'30%'}}>
<Button
type="primary"
htmlType="submit"
style={{ width: '30%' }}
>
Remove from Team
</Button>
</Form.Item>
</Form>
【问题讨论】:
-
请提供这个特定场景的 jsfiddle。